Commit dbbaacef authored by zw's avatar zw

pk

parent 268bf9dc
...@@ -77,4 +77,34 @@ class RankingList extends Basic{ ...@@ -77,4 +77,34 @@ class RankingList extends Basic{
return $this->response("200", "request null"); return $this->response("200", "request null");
} }
/**
* 查询分区业绩pk by 个人
* @return \think\Response
*/
public function getRandKingListByAgentId(){
$params = $this->params;
/*$params["position"] = 1;
/*$params["agent_id"] = 1;
$this->siteId = 10001;*/
if(!isset($params["position"]) || $params["position"] < 0 || $params["position"] > 5){
return $this->response("101","请求参数错误");
}
$result = $this->service_->RankingList( $params["position"],$this->siteId);
$agent_id = $params["agent_id"];
foreach ($result as $key=>$value){
$is_exits = false;
foreach ($value as $item){
if($item["id"] == $agent_id){
$is_exits = true;
}
}
if(!$is_exits){
unset($result[$key]);
}
}
if(count($result) > 0){
return $this->response("200","success",$result);
}
}
} }
\ No newline at end of file
...@@ -142,7 +142,7 @@ class ChatMsg extends Model ...@@ -142,7 +142,7 @@ class ChatMsg extends Model
$data = $this->db $data = $this->db
->where($params) ->where($params)
->count(); ->count();
echo $this->getLastSql();
return $data; return $data;
} }
......
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