Commit ba20c0db authored by zhuwei's avatar zhuwei

1

parent a291b239
...@@ -129,6 +129,7 @@ class RankingListService ...@@ -129,6 +129,7 @@ class RankingListService
{ {
$date = $this->getTotalDate($pk_type,1,$siteId); $date = $this->getTotalDate($pk_type,1,$siteId);
if (count($date) <= 0) { if (count($date) <= 0) {
return null; return null;
} }
...@@ -145,6 +146,8 @@ class RankingListService ...@@ -145,6 +146,8 @@ class RankingListService
return null; return null;
} }
//分组 //分组
$result = $this->group($resultArr, $siteId, $pk_type); $result = $this->group($resultArr, $siteId, $pk_type);
//循环分组后的数组,查询出各组本月业绩排行 //循环分组后的数组,查询出各组本月业绩排行
...@@ -159,15 +162,19 @@ class RankingListService ...@@ -159,15 +162,19 @@ class RankingListService
$param_now["a.status"] = 0; $param_now["a.status"] = 0;
$param_now['b.total_time'] = array('between', array($sort_begin_time, $sort_end_time)); $param_now['b.total_time'] = array('between', array($sort_begin_time, $sort_end_time));
foreach ($result as $index => $item) { foreach ($result as $index => $item) {
$ids = ""; $ids = "";
foreach ($item as $key => $value) { foreach ($item as $key => $value) {
$ids .= $value["id"] . ","; $ids .= $value["id"] . ",";
} }
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$param_now["a.id"] = array("in", $ids); $param_now["a.id"] = array("in", $ids);
$sort_arr = $this->getStoreSort($param_now, $sort_begin_time, $sort_end_time, $ids); $sort_arr = $this->getStoreSort($param_now, $sort_begin_time, $sort_end_time, $ids);
$result[$index] = $sort_arr; $result[$index] = $sort_arr;
} }
return $result; return $result;
} }
...@@ -287,8 +294,10 @@ class RankingListService ...@@ -287,8 +294,10 @@ class RankingListService
$fields = "a.id,a.store_name,SUM(b.performance) as performance"; $fields = "a.id,a.store_name,SUM(b.performance) as performance";
//查询出有业绩的经纪人 //查询出有业绩的经纪人
$have_performance_arr = $storeModel->getStoreListByPK($fields, $params); $have_performance_arr = $storeModel->getStoreListByPK($fields, $params);
//查询出无业绩的经纪人 //查询出无业绩的经纪人
$arr = $storeModel->getStoreListByPk1($params["a.site_id"], $begin_time, $end_time, $ids, $notIds); $arr = $storeModel->getStoreListByPk1($params["a.site_id"], $begin_time, $end_time, $ids, $notIds);
return array_merge($have_performance_arr, $arr); return array_merge($have_performance_arr, $arr);
} }
......
...@@ -334,7 +334,7 @@ class AStore extends BaseModel ...@@ -334,7 +334,7 @@ class AStore extends BaseModel
->group("b.store_id") ->group("b.store_id")
->order("performance desc") ->order("performance desc")
->select(); ->select();
//echo $this->getLastSql(); echo $this->getLastSql();exit;
return $data; return $data;
} }
public function getStoreListByPk1($siteId,$startTime,$endTime,$ids,$notIds){ public function getStoreListByPk1($siteId,$startTime,$endTime,$ids,$notIds){
......
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