Compare commits

...

2 Commits

Author SHA1 Message Date
weiz b4ebd357c2 fixed 2023-11-27 15:06:47 +08:00
weiz 85d7feffe4 Merge pull request '修改产品绑定逻辑' (#18) from zhangwei into dev
Reviewed-on: #18
2023-11-27 13:36:41 +08:00
1 changed files with 4 additions and 1 deletions

View File

@ -40,10 +40,13 @@
return $this->fail('图片参数格式错误'); return $this->fail('图片参数格式错误');
} }
//获取土地信息 //获取土地信息
$land = Land::field('residual_area')->where('id',$params['land_id'])->findOrEmpty(); $land = Land::field('user_id,residual_area')->where('id',$params['land_id'])->findOrEmpty();
if($land->isEmpty()){ if($land->isEmpty()){
return $this->fail('土地信息错误'); return $this->fail('土地信息错误');
} }
if($land['user_id'] != $this->userId){
return $this->fail('土地信息与用户信息不匹配');
}
if($params['area'] > $land['residual_area']){ if($params['area'] > $land['residual_area']){
return $this->fail('种植面积超过当前土地可种植面积'); return $this->fail('种植面积超过当前土地可种植面积');
} }