This commit is contained in:
unknown 2023-10-14 19:04:04 +08:00
parent 32fcb1700d
commit 27fd838861
1 changed files with 15 additions and 6 deletions

View File

@ -8,7 +8,7 @@ use think\response\Json;
class SuYuanController extends BaseAdminController
{
public array $notNeedLogin = ['areaLists','areaDetail','monitorDetail','imageUpload'];
public array $notNeedLogin = ['areaLists','areaDetail','monitorDetail','imageUpload','monitorList'];
//添加种植基地
public function addArea(): Json
@ -114,14 +114,23 @@ class SuYuanController extends BaseAdminController
return $this->fail('参数错误');
}
$data = Db::name('environmental_data')->where('production_base_id',$params['id'])->where('flag',$params['flag'])->order('id desc')->findOrEmpty();
if(empty($data)){
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);
}
public function monitorList() {
$params = $this->request->get(['id','flag']);
if(empty($params['id']) || empty($params['flag'])){
return $this->fail('参数错误');
}
$data = Db::name('environmental_data')->where('production_base_id',$params['id'])->where('flag',$params['flag'])->limit(6)->select();
$content = Db::name('production_base')->where('id',$params['id'])->field('content')->findOrEmpty();
$result = [];
foreach ($data as $v) {
}
dump($data);die;
}
//上传图片
public function imageUpload(): Json
{