Commit 398a6a14 authored by zw's avatar zw

pk

parent ab1eaeab
......@@ -23,7 +23,7 @@ class RankingList extends Basic{
public function getRandKingList(){
$params = $this->params;
/* $params["position"] = 1;
/*$params["position"] = 1;
$this->siteId = 10001;*/
if(!isset($params["position"]) || $params["position"] < 0 || $params["position"] > 5){
return $this->response("101","请求参数错误");
......
......@@ -433,19 +433,17 @@ class AAgents extends BaseModel
}
public function getAgentListByPk1($siteId,$position,$startTime,$endTime,$ids){
$str_ids = " ";
$str_ids1 = " ";
if($ids){
$str_ids = " and id in ($ids)";
$str_ids1 = " and a.id in ($ids)";
$str_ids = " and a.id in ($ids)";
}
$sql = "select aa.id,aa.store_name,aa.name,aa.phone,aa.performance from
(select a.id,c.store_name,a.name,a.phone,0 as performance from a_agents a
left join a_store c on a.store_id=c.id
where position=$position and site_id=$siteId and status in (0,3) $str_ids )
where a.position=$position and a.site_id=$siteId and a.status in (0,3) $str_ids )
as aa left join
(select a.id,c.store_name,a.name,a.phone,0 as performance from a_agents a
left join t_agent_total b on a.id=b.agent_id left join a_store c on a.store_id=c.id
where b.total_time BETWEEN '$startTime' and '$endTime'and a.status in (0,3) $str_ids1 GROUP BY b.agent_id )
where b.total_time BETWEEN '$startTime' and '$endTime'and a.status in (0,3) $str_ids GROUP BY b.agent_id )
as bb on aa.id = bb.id where bb.id is null" ;
$data = Db::table($this->table)->query($sql);
//echo $this->getLastSql();
......
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