fixed #2

Merged
weiz merged 1 commits from dev into master 2023-10-14 17:00:12 +08:00
1 changed files with 4 additions and 1 deletions

View File

@ -114,6 +114,9 @@ class SuYuanController extends BaseAdminController
return $this->fail('参数错误'); return $this->fail('参数错误');
} }
$data = Db::name('environmental_data')->where('id',$params['id'])->where('flag',$params['flag'])->order('id desc')->findOrEmpty(); $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(); $content = Db::name('production_base')->where('id',$data['production_base_id'])->field('content')->findOrEmpty();
$data['content'] = $content['content']; $data['content'] = $content['content'];
return $this->success('请求成功',$data); return $this->success('请求成功',$data);
@ -132,4 +135,4 @@ class SuYuanController extends BaseAdminController
$save_name = Filesystem::disk('public')->putFile( '', $file); $save_name = Filesystem::disk('public')->putFile( '', $file);
return $this->success('上传成功',['image'=>$this->request->domain().$save_name]); return $this->success('上传成功',['image'=>$this->request->domain().$save_name]);
} }
} }