Commit d9239b18 authored by clone's avatar clone

1

parent 238410c4
...@@ -1220,5 +1220,47 @@ class Broker extends Basic ...@@ -1220,5 +1220,47 @@ class Broker extends Basic
return $this->response($code, $msg); return $this->response($code, $msg);
} }
/**
* 查询经纪人的监管人
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSuperintendent()
{
$agent_id = $this->request->param("agent_id");
if (!$agent_id) {
return $this->response(101, '经纪人id不能为空');
}
$redisCache = new RedisCacheService();
$agentInfo = $redisCache->getRedisCache(2, $agent_id);
$result["superintendent_name"] = "";
$params = [];
if ($agentInfo["level"] == 10) {
$params["store_id"] = $agentInfo["store_id"];
$params["level"] = array("in", "20,40");
$params["status"] = 0;
} else if ($agentInfo["level"] == 20) {
$params["district_id"] = $agentInfo["district_id"];
$params["level"] = array("in", "30,40");
$params["status"] = array("in", "0,1,3");//总监可能转勤
} else {
$result["superintendent_name"] = "施总";
}
if (!$result["superintendent_name"]) {
$agentModel = new AAgents();
$info = $agentModel->getAgentById("id,name", $params);
if ($info) {
$result["superintendent_name"] = $info[0]["name"];
}
}
if (count($result) > 0) {
return $this->response("200", "success", $result);
} else {
return $this->response("101", "账号异常");
}
}
} }
\ No newline at end of file
...@@ -263,7 +263,7 @@ class AAgents extends BaseModel ...@@ -263,7 +263,7 @@ class AAgents extends BaseModel
$result = $this->field($field) $result = $this->field($field)
->where($where_) ->where($where_)
->select(); ->select();
// echo $this->getLastSql(); echo $this->getLastSql();
return $result; return $result;
} }
......
...@@ -829,6 +829,7 @@ Route::group('broker', [ ...@@ -829,6 +829,7 @@ Route::group('broker', [
'updateBindAXB' => ['api_broker/CellPhone/updateBindAXB', ['method' => 'post']], //更新绑定关系隐私号码 'updateBindAXB' => ['api_broker/CellPhone/updateBindAXB', ['method' => 'post']], //更新绑定关系隐私号码
'getCallLog' => ['api_broker/broker/getCallLog', ['method' => 'get|post']], 'getCallLog' => ['api_broker/broker/getCallLog', ['method' => 'get|post']],
'editBank' => ['api_broker/broker/editBank', ['method' => 'post']], //我的-工资卡 'editBank' => ['api_broker/broker/editBank', ['method' => 'post']], //我的-工资卡
'getSuperintendent' => ['api_broker/broker/getSuperintendent', ['method' => 'post|get']],
'agentUserTb' => ['api_broker/Client/agentUserTb', ['method' => 'get']],//客户列表 'agentUserTb' => ['api_broker/Client/agentUserTb', ['method' => 'get']],//客户列表
......
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