Commit ba20c0db authored by zhuwei's avatar zhuwei

1

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