Commit f39d740b authored by hujun's avatar hujun

修改用户列表

parent b6cfe8ca
......@@ -20,13 +20,18 @@ use think\Session;
class Remark extends Basic
{
//跟进主界面
/**
* 跟进主界面
*
* @return \think\response\View
*/
public function remarkFollowIndex(){
return view('remark_follow_index');
}
/**跟进列表
/**
* 跟进列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
......@@ -91,9 +96,14 @@ class Remark extends Basic
// prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr
return $this->response(200,'成功',$data);
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
......@@ -111,18 +121,12 @@ class Remark extends Basic
$field='id,apply_id,shopuser_id,content,house_id,created,admin,';
$where="isinstatus=1 and content like '%【跟进】%' and apply_id='{$applyId}'";
$data['list'] = $table->field($field)->where($where)->select();
}else{
return $this->response(100,'失败,没有apply_id',$data);
}
return $this->response(200,'成功',$data);
}
/**
* 客户动态展示加搜索加客户详情
*
......@@ -135,13 +139,6 @@ class Remark extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
$params['user_id'] ='1';
// if (!isset($params['user_id'])) {
// return $this->response("300", "参数不全", [ 'remote_groupid' => '' ]);
// }
$searchdate = $params['searchdate'];
$pagenum = isset($params['pagenum']) ? $params['pagenum'] : 1;
$pagesize = 15;
......@@ -149,46 +146,33 @@ class Remark extends Basic
$UPhoneFollowPp = new UPhoneFollowPp();
// 查询电话跟进数据
$UPhoneFollowPp_res=$UPhoneFollowPp->select_useraction_search($user_id,$searchdate);
//var_dump($UPhoneFollowPp_res);
/*dump($total);
var_dump($user_res);
exit;*/
//dump($UPhoneFollowPp_res);
$UPhoneFollowPp_res = $UPhoneFollowPp->select_useraction_search($user_id,$searchdate);
foreach($UPhoneFollowPp_res as $k=>$v){
$table= new AAgents();
$Agents_res =$table->Agents_res($v['agent_id']);
//dump($Agents_res);
$UPhoneFollowPp_res[$k]['agentinfo']=$Agents_res?$Agents_res['store_name'].'-'.$Agents_res['name']:'未知';
$UPhoneFollowPp_res[$k]['user_pic']=AGENTHEADERIMGURL.$Agents_res['img'];
$UPhoneFollowPp_res[$k]['label']='';
//dump($v['labels_id']);
$table = new AAgents();
$Agents_res = $table->Agents_res($v['agent_id']);
$UPhoneFollowPp_res[$k]['agentinfo'] = $Agents_res?$Agents_res['store_name'].'-'.$Agents_res['name']:'未知';
$UPhoneFollowPp_res[$k]['user_pic'] = AGENTHEADERIMGURL.$Agents_res['img'];
$UPhoneFollowPp_res[$k]['label'] = '';
//电话跟进标签
if($v['labels_id']){
$table= new ULabels();
$table_res =$table->get_labelsname($v['labels_id']);
//dump($table_res);
//exit;
$UPhoneFollowPp_res[$k]['label']=$table_res[0]['name'];
$table_res = $table->get_labelsname($v['labels_id']);
$UPhoneFollowPp_res[$k]['label'] = $table_res[0]['name'];
}
}
$user = new Users();
$user_res =$user->useraction_search_user_res($user_id);
//dump($user_res);
$user_res['user_pic']=HEADERIMGURL.$user_res['user_pic'];
$table= new AAgents();
$Agents_res =$table->Agents_res($user_res['agent_id']);
//dump($Agents_res);
$user_res['agentinfo']=$Agents_res?$Agents_res['name'].'/'.$Agents_res['phone']:'未知';
$user_res = $user->useraction_search_user_res($user_id);
$user_res['user_pic'] = HEADERIMGURL.$user_res['user_pic'];
$table = new AAgents();
$Agents_res = $table->Agents_res($user_res['agent_id']);
$user_res['agentinfo'] = $Agents_res?$Agents_res['name'].'/'.$Agents_res['phone']:'未知';
$records = new GOperatingRecords();
$records_result = $records->user_history($user_id);
//dump($records_result);
//dump($user_id);
return $this->response("200", "success!", ['user_info'=>$user_res,'user_date'=>$UPhoneFollowPp_res,'user_history'=>$records_result]);
}
......@@ -257,6 +241,4 @@ class Remark extends Basic
//dump($total);
return $this->response("200", "success!", ['user_date'=>$UPhoneFollowPp_res,'pagenum'=>$pagenum,'total'=>$total]);
}
}
\ No newline at end of file
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