Commit 1b3335b6 authored by zw's avatar zw

pk

parent ab12e9fa
...@@ -66,6 +66,7 @@ class Basic extends Controller ...@@ -66,6 +66,7 @@ class Basic extends Controller
'index/shareShop', 'index/shareShop',
'index/yindaoAndroid', 'index/yindaoAndroid',
'index/yindaoIos', 'index/yindaoIos',
'index/exportReport',
); );
/** /**
......
...@@ -76,8 +76,6 @@ class RankingListService ...@@ -76,8 +76,6 @@ class RankingListService
} }
} }
} }
//循环分组后的数组,查询出各组本月业绩排行 //循环分组后的数组,查询出各组本月业绩排行
...@@ -105,7 +103,7 @@ class RankingListService ...@@ -105,7 +103,7 @@ class RankingListService
} }
public function getSort($params,$begin_time, $end_time,$ids){ public function getSort($params,$begin_time, $end_time,$ids){
$fields = "a.id,a.store_id,a.district_id,a.name,a.phone,SUM(b.performance) as performance"; $fields = "a.id,c.store_name,a.name,a.phone,SUM(b.performance) as performance";
//查询出有业绩的经纪人 //查询出有业绩的经纪人
$have_performance_arr = $this->agentModel->getAgentsListByPK($fields, $params); $have_performance_arr = $this->agentModel->getAgentsListByPK($fields, $params);
//查询出无业绩的经纪人 //查询出无业绩的经纪人
......
...@@ -423,6 +423,7 @@ class AAgents extends BaseModel ...@@ -423,6 +423,7 @@ class AAgents extends BaseModel
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("t_agent_total b","a.id=b.agent_id","left") ->join("t_agent_total b","a.id=b.agent_id","left")
->join("a_store c","a.store_id=c.id","left")
->where($params) ->where($params)
->group("b.agent_id") ->group("b.agent_id")
->order("performance desc") ->order("performance desc")
...@@ -437,12 +438,13 @@ class AAgents extends BaseModel ...@@ -437,12 +438,13 @@ class AAgents extends BaseModel
$str_ids = " and id in ($ids)"; $str_ids = " and id in ($ids)";
$str_ids1 = " and a.id in ($ids)"; $str_ids1 = " and a.id in ($ids)";
} }
$sql = "select aa.id,aa.store_id,aa.district_id,aa.name,aa.phone,aa.performance from $sql = "select aa.id,aa.store_name,aa.name,aa.phone,aa.performance from
(select id,store_id,district_id,name,phone,0 as performance from a_agents (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 position=$position and site_id=$siteId and status in (0,3) $str_ids )
as aa left join as aa left join
(select a.id,a.store_id,a.district_id,a.name,a.phone,0 as performance from a_agents a (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 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_ids1 GROUP BY b.agent_id )
as bb on aa.id = bb.id where bb.id is null" ; as bb on aa.id = bb.id where bb.id is null" ;
$data = Db::table($this->table)->query($sql); $data = Db::table($this->table)->query($sql);
......
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