diff --git a/application/common/model/Images.php b/application/common/model/Images.php
index 4a0bf5c6..62aa24b0 100644
--- a/application/common/model/Images.php
+++ b/application/common/model/Images.php
@@ -14,6 +14,8 @@ class Images extends Model
{
protected $updateTime = false;
+ protected $insert = ['ip'];
+
public function getUrlAttr($url, $data)
{
// 图片链接
@@ -24,4 +26,9 @@ class Images extends Model
$domain = $cdnDoamin ? $cdnDoamin : request()->domain();
return make_url($domain, $data['pathname']);
}
+
+ public function setIpAttr()
+ {
+ return request()->ip();
+ }
}
\ No newline at end of file
diff --git a/application/index/view/admin/images/index.html b/application/index/view/admin/images/index.html
index ca1984cd..2d7b1d42 100644
--- a/application/index/view/admin/images/index.html
+++ b/application/index/view/admin/images/index.html
@@ -35,6 +35,7 @@
路径 |
大小 |
类型 |
+ 上传IP |
上传时间 |
操作 |
@@ -47,6 +48,7 @@
{$value.pathname} |
{$value.size|format_size} |
{$value.mime} |
+ {$value.ip} |
{$value.create_time} |
diff --git a/install.sql b/install.sql
index be679197..1aaa79b2 100644
--- a/install.sql
+++ b/install.sql
@@ -81,7 +81,6 @@ INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `
(40, 'upyun', 'text', 'text', 'upyun_service_name', 'ServiceName', '云储存服务名称', '', ''),
(41, '', 'text', 'text', 'system_version', '系统版本', NULL, '1.0', '');
-
-- --------------------------------------------------------
--
@@ -100,6 +99,7 @@ CREATE TABLE IF NOT EXISTS `lsky_images` (
`mime` varchar(32) NOT NULL COMMENT '文件MIME类型',
`sha1` varchar(100) NOT NULL COMMENT 'hash sha1',
`md5` varchar(32) NOT NULL COMMENT 'hash md5',
+ `ip` varchar(128) DEFAULT NULL COMMENT '上传者IP',
`create_time` int(11) NOT NULL COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='图片表';
|