From ec3e4e3a79fbe0bed1cf81e249c2a1294c0f6ff4 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Mon, 22 Oct 2018 22:33:36 +0800 Subject: [PATCH] update --- application/common/model/Images.php | 7 +++++++ application/index/view/admin/images/index.html | 2 ++ install.sql | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) 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 @@