From b205950ac3c01b40dd44f045562e35374a28723b Mon Sep 17 00:00:00 2001 From: weiz Date: Mon, 4 Dec 2023 11:57:33 +0800 Subject: [PATCH] update --- app/api/controller/ActionController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/api/controller/ActionController.php b/app/api/controller/ActionController.php index 93543653..e7cb0c06 100644 --- a/app/api/controller/ActionController.php +++ b/app/api/controller/ActionController.php @@ -41,6 +41,9 @@ return $this->fail('操作内容格式错误'); } foreach($this->actionFields[$params['type']] as $v) { + if($v == 'remark'){ + continue; + } if(empty($detail[$v])){ return $this->fail($this->actionMessage[$params['type']].'缺少必要参数'); } @@ -103,6 +106,8 @@ $data = Db::query("SELECT * FROM zzsy_land_plant_action WHERE id IN (SELECT max( id ) FROM zzsy_land_plant_action WHERE plant_id = {$params['plant_id']} GROUP BY type)"); foreach($data as $k=>$v){ $data[$k]['detail'] = json_decode($v['detail'],true); + $data[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']); + $data[$k]['update_time'] = date('Y-m-d H:i:s',$v['update_time']); } return $this->success('请求成功',$data); } @@ -116,6 +121,8 @@ } $data = Action::where('plant_id',$params['plant_id'])->where('type',$params['type'])->order('create_time desc')->select()->each(function($item){ $item['detail'] = json_decode($item['detail'],true); + $item['create_time'] = date('Y-m-d H:i:s',$item['create_time']); + $item['update_time'] = date('Y-m-d H:i:s',$item['update_time']); return $item; })->toArray(); return $this->success('请求成功',$data);