From c29c033a5b0c5068bd5c656a7b02b174943af2db Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 14 Sep 2023 10:16:54 +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/Index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controller/Index.php b/app/controller/Index.php index 3214d47..386e360 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -121,10 +121,11 @@ class Index extends BaseController validate()->rule(['id|公告id' => 'require|number'])->check($param); $Notice = Notice::where('id',$param['id'])->order('sort asc,id desc')->find(); - + $create_time = $Notice->create_time; + if (!empty($Notice->update_time)) $create_time = $Notice->update_time; return $this->renderSuccess('数据返回成功',[ 'title' => $Notice->title, - 'create_time' => date("Y.m.d H:i:s",strtotime($Notice->create_time)), + 'create_time' => date("Y.m.d H:i:s",strtotime($create_time)), 'content' => $Notice->content ]); } catch (ValidateException $validateException) {