From 1389e5848af2a037cc3ff76748ca5e6973a95b04 Mon Sep 17 00:00:00 2001 From: weiz Date: Tue, 31 Oct 2023 16:26:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=87=E8=AE=B0=E5=9C=9F?= =?UTF-8?q?=E5=9C=B0=E5=85=A8=E9=83=A8=E6=88=90=E7=86=9F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/LandPlantController.php | 11 +++++++++++ app/api/controller/UserController.php | 1 + 2 files changed, 12 insertions(+) diff --git a/app/api/controller/LandPlantController.php b/app/api/controller/LandPlantController.php index 02dca50e..a466811c 100644 --- a/app/api/controller/LandPlantController.php +++ b/app/api/controller/LandPlantController.php @@ -83,6 +83,7 @@ 'crop_name' => $params['crop_name'], 'crop_variety' => $params['crop_variety'], 'crop_brand' => $params['crop_brand'], + 'flag' => 1, 'seed_time' => time(), 'crop_buy_time' => strtotime($params['crop_buy_time']) ]); @@ -98,6 +99,16 @@ return $this->success('添加成功',[],1,1); } + //标记全部成熟 + public function landCropAllRipe() { + $params = $this->request->post(['crop_id']); + if(empty($params['crop_id'])){ + return $this->fail('参数错误'); + } + $result = Db::name('farmer_land_crop')->where('crop_id',$params['crop_id'])->update(['flag'=>2]); + return $result ? $this->success('请求成功',[],1,1) : $this->fail('请求失败',[],1,1); + } + //添加播种图片 public function addLandCropPic(): Json { diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php index 3e2057a8..c9a4e364 100644 --- a/app/api/controller/UserController.php +++ b/app/api/controller/UserController.php @@ -35,6 +35,7 @@ class UserController extends BaseApiController $land_crop = Db::name('farmer_land_crop')->where([ ['user_id','=',$params['user_id']], ['land_id','=',$v['land_id']], + ['flag','=',1] ])->order('id desc')->findOrEmpty(); if(!empty($land_crop)){ $lands[$k]['is_cropped'] = true;