Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
8a0e4a0b4b
@ -12,7 +12,7 @@ use think\response\Json;
|
|||||||
|
|
||||||
class InformationController extends BaseApiController
|
class InformationController extends BaseApiController
|
||||||
{
|
{
|
||||||
public array $notNeedLogin = ['farmerInfo'];
|
public array $notNeedLogin = ['farmerInfo','farmerLandInfo'];
|
||||||
|
|
||||||
public function list()
|
public function list()
|
||||||
{
|
{
|
||||||
@ -139,10 +139,13 @@ class InformationController extends BaseApiController
|
|||||||
//获取参数
|
//获取参数
|
||||||
$params = $this->request->post(['user_id']);
|
$params = $this->request->post(['user_id']);
|
||||||
if(empty($params['user_id'])){
|
if(empty($params['user_id'])){
|
||||||
return $this->fail('参数错误');
|
return $this->fail('参数错误_worker');
|
||||||
}
|
}
|
||||||
//获取农户信息
|
//获取农户信息
|
||||||
$farmerInfo = UserInformationg::where('id', $params['user_id'])->field('id,create_user_id,company_id,name,phone,area_id,street_id,village_id,brigade_id,area_id area_name,street_id street_name,village_id village_name,brigade_id brigade_name')->find()->toArray();
|
$farmerInfo = UserInformationg::where('id', $params['user_id'])->field('id,create_user_id,company_id,name,phone,area_id,street_id,village_id,brigade_id,area_id area_name,street_id street_name,village_id village_name,brigade_id brigade_name')->findOrEmpty()->toArray();
|
||||||
|
if(empty($farmerInfo)){
|
||||||
|
return $this->fail('用户不存在_worker');
|
||||||
|
}
|
||||||
unset($farmerInfo['area_id'],$farmerInfo['street_id'],$farmerInfo['village_id'],$farmerInfo['brigade_id']);
|
unset($farmerInfo['area_id'],$farmerInfo['street_id'],$farmerInfo['village_id'],$farmerInfo['brigade_id']);
|
||||||
$data = UserInformationgDemand::field('id,category_child,data')->where('information_id', $params['user_id'])->where('category_id',6)->where('category_child','in','7,32')->order('id', 'desc')->select()->toArray();
|
$data = UserInformationgDemand::field('id,category_child,data')->where('information_id', $params['user_id'])->where('category_id',6)->where('category_child','in','7,32')->order('id', 'desc')->select()->toArray();
|
||||||
//是否是种植户
|
//是否是种植户
|
||||||
@ -191,4 +194,24 @@ class InformationController extends BaseApiController
|
|||||||
}
|
}
|
||||||
return $this->success('请求成功',$farmerInfo);
|
return $this->success('请求成功',$farmerInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取农户土地信息
|
||||||
|
public function farmerLandInfo(): Json
|
||||||
|
{
|
||||||
|
//获取参数
|
||||||
|
$params = $this->request->post(['user_id','land_id']);
|
||||||
|
if(empty($params['user_id']) || empty($params['land_id'])){
|
||||||
|
return $this->fail('参数错误_worker');
|
||||||
|
}
|
||||||
|
//获取农户信息
|
||||||
|
$data = UserInformationgDemand::field('id,data')->where('id',$params['land_id'])->where('information_id', $params['user_id'])->where('category_id',6)->where('category_child','7')->findOrEmpty()->toArray();
|
||||||
|
if(empty($data)){
|
||||||
|
return $this->fail('数据不存在_worker');
|
||||||
|
}
|
||||||
|
$resData = [
|
||||||
|
'land_id' => $data['id'],
|
||||||
|
'land_area' => $data['data']['area']
|
||||||
|
];
|
||||||
|
return $this->success('请求成功',$resData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user