From af957b1bd0c8323eeda0953c8cd0595e3f176178 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 14 Sep 2023 10:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Notice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controller/Notice.php b/app/controller/Notice.php index 4c05eea..c7f0afb 100644 --- a/app/controller/Notice.php +++ b/app/controller/Notice.php @@ -29,7 +29,7 @@ class Notice extends BaseController $NoticeModel = new NoticeModel(); # 查询用户列表 - $field = 'id,title,sort,content,create_time'; + $field = 'id,title,sort,content,create_time,update_time'; $res = $NoticeModel->field($field)->where($where)->order('sort asc,id desc')->paginate($limit); $listArr = $res->toArray(); @@ -37,7 +37,11 @@ class Notice extends BaseController $total = $listArr['total']; foreach ($list as &$item) { + if (!empty($item['update_time'])) { + $item["create_time"] = $item["update_time"]; + } $item["create_time"] = date("Y.m.d H:i:s",strtotime($item['create_time'])); + unset($item["update_time"]); } return $this->renderSuccess('数据返回成功', ['list' => $list, 'total' => $total]);