From 504587ebaa9f9e1eed900abbfb9ad9bdfc6292fe Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Sat, 14 Oct 2023 16:57:36 +0800 Subject: [PATCH] fixed --- app/adminapi/controller/SuYuanController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/adminapi/controller/SuYuanController.php b/app/adminapi/controller/SuYuanController.php index 555508f0..bc4bc6dd 100644 --- a/app/adminapi/controller/SuYuanController.php +++ b/app/adminapi/controller/SuYuanController.php @@ -114,6 +114,9 @@ class SuYuanController extends BaseAdminController return $this->fail('参数错误'); } $data = Db::name('environmental_data')->where('id',$params['id'])->where('flag',$params['flag'])->order('id desc')->findOrEmpty(); + if($data->isEmpty()){ + return $this->success('请求成功',[]); + } $content = Db::name('production_base')->where('id',$data['production_base_id'])->field('content')->findOrEmpty(); $data['content'] = $content['content']; return $this->success('请求成功',$data); @@ -132,4 +135,4 @@ class SuYuanController extends BaseAdminController $save_name = Filesystem::disk('public')->putFile( '', $file); return $this->success('上传成功',['image'=>$this->request->domain().$save_name]); } -} \ No newline at end of file +}