From 1fec29c5e8fff418e5e1ccd7f5690c9679dcd1c7 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Fri, 8 Sep 2023 17:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E5=B8=83=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Notice.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controller/Notice.php b/app/controller/Notice.php index ad04392..e9ad710 100644 --- a/app/controller/Notice.php +++ b/app/controller/Notice.php @@ -22,14 +22,19 @@ class Notice extends BaseController $where = []; - $CustomerServiceModel = new NoticeModel(); + $NoticeModel = new NoticeModel(); # 查询用户列表 - $field = 'id,title,sort,content'; - $res = $CustomerServiceModel->field($field)->where($where)->order('sort asc,id desc')->paginate($limit); + $field = 'id,title,sort,content,create_time'; + $res = $NoticeModel->field($field)->where($where)->order('sort asc,id desc')->paginate($limit); - $list = $res->items(); - $total = $res->total(); + $listArr = $res->toArray(); + $list = $listArr['data']; + $total = $listArr['total']; + + foreach ($list as &$item) { + $item["create_time"] = date("Y.m.d H:i:s",strtotime($item['create_time'])); + } return $this->renderSuccess('数据返回成功', ['list' => $list, 'total' => $total]); }