Commit 48ca39be authored by zhuwei's avatar zhuwei

客户详情修改

parent 44ca48bb
...@@ -171,8 +171,7 @@ class Remark extends Basic ...@@ -171,8 +171,7 @@ class Remark extends Basic
} }
/** /**
* 客户动态展示加搜索加客户详情 * 客户详情
*
* @return \think\Response * @return \think\Response
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\DbException * @throws \think\exception\DbException
...@@ -180,11 +179,16 @@ class Remark extends Basic ...@@ -180,11 +179,16 @@ class Remark extends Basic
public function useraction_search() public function useraction_search()
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
"user_id" => 256
);*/
if (empty($this->params['user_id'])) { if (empty($params['user_id'])) {
return $this->response(101,'客户信息错误'); return $this->response(101,'客户信息错误');
} }
$params = $this->params;
$searchdate = $params['searchdate']; $searchdate = $params['searchdate'];
$pagenum = isset($params['pagenum']) ? $params['pagenum'] : 1; $pagenum = isset($params['pagenum']) ? $params['pagenum'] : 1;
$pagesize = 15; $pagesize = 15;
...@@ -233,7 +237,40 @@ class Remark extends Basic ...@@ -233,7 +237,40 @@ class Remark extends Basic
$records = new GOperatingRecords(); $records = new GOperatingRecords();
$records_result = $records->user_history($user_id); $records_result = $records->user_history($user_id);
return $this->response("200", "success!", ['user_info'=>$user_res,'user_date'=>$UPhoneFollowPp_res,'user_history'=>$records_result]);
//todo 查询客户邀请人 1 邀请人是客户还是经纪人 2 经纪人:邀请人姓名,手机号 客户:姓名 id
/*引荐人来源 10:会员 20:b端经纪人*/
if($user_res['referrer_source']== 0){
$user_invite_info=[];
}elseif($user_res['referrer_source']== 10){
$userArr = $user->selectUser($user_res['referrer_id'], "id,user_phone");
if(!$userArr){
$user_invite_info=[];
}else{
$user_invite_info['referrer_source'] = $user_res['referrer_source'];
$user_invite_info['user_phone'] = $userArr['user_phone'];
$user_invite_info['id'] = $userArr['id'];
}
}else{
$model = new AAgents();
$result = $model->searchAgentsByKeyword("id,name,phone", [ "id" => $user_res['referrer_id'] ]);
if(!$result){
$user_invite_info=[];
}else{
$user_invite_info['referrer_source'] = $user_res['referrer_source'];
$user_invite_info['name'] = $result[0]['name'];
$user_invite_info['phone'] = $result[0]['phone'];
}
}
return $this->response("200", "success!", [
'user_info' => $user_res,
'user_date' => $UPhoneFollowPp_res,
'user_history' => $records_result,
'user_invite_info' => $user_invite_info,
]
);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment