Commit c302622a authored by zw's avatar zw

pk

parent bb17f7ef
...@@ -4,6 +4,7 @@ namespace app\index\controller; ...@@ -4,6 +4,7 @@ namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\RankingListService; use app\index\service\RankingListService;
use app\index\untils\ExportExcelUntil; use app\index\untils\ExportExcelUntil;
use app\model\AAgents;
use think\Request; use think\Request;
/** /**
...@@ -78,19 +79,27 @@ class RankingList extends Basic{ ...@@ -78,19 +79,27 @@ class RankingList extends Basic{
} }
/** /**
* 查询分区业绩pk by 个人 * 查询分区业绩pk by 个人
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getRandKingListByAgentId(){ public function getRandKingListByAgentId(){
$params = $this->params; $params = $this->params;
/*$params["position"] = 1;
/*$params["agent_id"] = 1; /*$params["agent_id"] = 1;
$this->siteId = 10001;*/ $this->siteId = 10001;*/
if(!isset($params["position"]) || $params["position"] < 0 || $params["position"] > 5){ if(!isset($params["agent_id"])){
return $this->response("101","请求参数错误"); return $this->response("101","请求参数错误");
} }
$result = $this->service_->RankingList( $params["position"],$this->siteId); $agentModel = new AAgents();
$agent_info = $agentModel->getAgentInfo("id,position",$params["agent_id"]);
if($agent_info["position"] == 5){
return $this->response("101","该经纪人没有分配职称");
}
$result = $this->service_->RankingList( $agent_info["position"],$this->siteId);
$agent_id = $params["agent_id"]; $agent_id = $params["agent_id"];
foreach ($result as $key=>$value){ foreach ($result as $key=>$value){
$is_exits = false; $is_exits = false;
...@@ -106,5 +115,6 @@ class RankingList extends Basic{ ...@@ -106,5 +115,6 @@ class RankingList extends Basic{
if(count($result) > 0){ if(count($result) > 0){
return $this->response("200","success",$result); return $this->response("200","success",$result);
} }
return $this->response("200","null");
} }
} }
\ 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