Commit df4313bf authored by zhuwei's avatar zhuwei

获取电话跟进标签列表

parent 43c5d008
......@@ -10,6 +10,7 @@ use app\api_broker\service\VipService;
use app\index\service\UserLogService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\ULabels;
use app\model\UPhoneFollowPp;
use app\model\Users;
use think\Log;
......@@ -35,6 +36,18 @@ class User extends Basic
}
/**
* 获取电话跟进标签列表
* @return \think\Response
*/
public function getUserLabels() {
$m_lables = New ULabels;
$field = 'id as labels_id,name';
$where['type'] = 1;
$result= $m_lables->getLabelsList($field, $where);
return $this->response("200", "request success", $result);
}
/**
* 客户搜索条件
* @return \think\Response
......@@ -723,7 +736,7 @@ class User extends Basic
{
$params = $this->params;
$params = array(
"user_id" => 828,
"user_id" => 187,
"agent_id" => 1,
);
......@@ -737,8 +750,8 @@ class User extends Basic
$s_index_user = new UserService();
$result['user_bind_list'] = $s_index_user->userBindInfo($params['user_id']);
if($result["code"] == 200){
return $this->response("200", "success!", $result["data"]);
if($result){
return $this->response("200", "success!", $result);
}else{
return $this->response("101", $result["msg"]);
}
......
......@@ -62,6 +62,7 @@ class Basic extends Controller
"broker/getVolume",
"broker/getCityInfoByMap",
"broker/getShopListByMap",
"broker/getUserLabels",
);
/**
......
......@@ -220,17 +220,18 @@ class UserLogService
{
//查询客户详情
$field = 'id,user_pic,name,phone,site_ids,agent_id';
$user_res = $this->userModel->getUserDetailStreamline($user_id,$field);
if (count($user_res) <= 0) {
$field = 'id as user_id,user_pic,user_nick,user_name,user_phone,site_ids,agent_id';
$result = $this->userModel->getUserDetailStreamline($user_id,$field);
if (count($result) <= 0) {
return ["code" => 101, "msg" => "没找到此条用户信息"];
}
$user_res['user_pic'] = HEADERIMGURL . $user_res['user_pic'];
$result['user_pic'] = HEADERIMGURL . $result['user_pic'];
$result['agent_path'] = AGENTHEADERIMGURL;
/*查询站点名*/
$site_model = new ASite();
foreach (explode(',', $user_res['site_ids']) as $site_k => $site_v) {
foreach (explode(',', $result['site_ids']) as $site_k => $site_v) {
$site_field = 'city';
$site_params['id'] = $site_v;
$site_model = $site_model->findByOne($site_field, $site_params);
......@@ -273,13 +274,13 @@ class UserLogService
$model = new AAgents();
$agent_res = $model->searchAgentsByKeyword("id,name,phone", ["id" => $agent_id]);
$call = new CallPhoneService();
$bind_num_res = $call->getBindNum($user_res['user_phone'], $agent_res[0]['phone']);
$bind_num_res = $call->getBindNum($result['user_phone'], $agent_res[0]['phone']);
if ($bind_num_res != 0) {
$result['is_outpace_call_num'] = 0;
}
//查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$result['is_can_look'] = $user_service->isUserAgentDirector($user_res["agent_id"], $agent_id);
$result['is_can_look'] = $user_service->isUserAgentDirector($result["agent_id"], $agent_id);
$vip_services = new VipService();
//是否可以查看vip客户 0:可查看 1:不可查看
$result['examine_vip'] = $vip_services->vip($agent_id);
......
......@@ -25,7 +25,6 @@ class ULabels extends BaseModel
*/
public function uleList($where)
{
$r= $this->db_->where($where)->select();
return $r;
}
......@@ -78,4 +77,14 @@ class ULabels extends BaseModel
->column($field);
}
public function getLabelsList($field, $where)
{
return $this->db_
->where($where)
->field($field)
->select();
}
}
......@@ -601,7 +601,8 @@ Route::group('broker', [
'agentUserTb' => ['api_broker/Client/agentUserTb', ['method' => 'get']],//客户列表
'agentUserFollow' => ['api_broker/Client/agentUserFollow', ['method' => 'get']],//客户列表
'agentSearch' => ['api_broker/Client/agentSearch', ['method' => 'get']],//经纪人搜索
'getULabelsListApp' => ['api_broker/Client/getULabelsListApp', ['method' => 'get']],//客户标签
'getULabelsListApp' => ['api_broker/Client/getULabelsListApp', ['method' => 'get|post']],//客户标签
'getULabelsList' => ['api_broker/Client/getULabelsListApp', ['method' => 'get|post']],//客户标签
'all_user' => ['api_broker/Client/all_user', ['method' => 'post|get']],//全部客户 朱伟
'inviteList' => ['api_broker/Client/inviteList', ['method' => 'get']], //邀请记录
//商铺
......@@ -752,6 +753,7 @@ Route::group('broker', [
'adjustment' => ['api_broker/PayLog/adjustment', ['method' => 'get|post']],
//原生客户详情
'getUserLabels' => ['api_broker/User/getUserLabels', ['method' => 'get|post']],//获取电话跟进标签列表
'userDetail' => ['api_broker/User/userDetail', ['method' => 'get|post']],//
......
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