Commit 63e6cfb1 authored by zw's avatar zw

bug

parent 175de13d
......@@ -142,8 +142,10 @@ class RankingListService
$end_time = date("Y-m-d 23:59:59", strtotime(-date('d') . 'day'));
$params["a.site_id"] = $siteId;
$params["a.status"] = 0;
$params["a.id"] = array("not in","5288,3742,5292");
$params['b.total_time'] = array('between', array($begin_time, $end_time));
$resultArr = $this->getStoreSort($params, $begin_time, $end_time, "");
$resultArr = $this->getStoreSort($params, $begin_time, $end_time, "",$notIds = "5288,3742,5292");
if (count($resultArr) <= 0) {
return null;
}
......@@ -178,20 +180,20 @@ class RankingListService
* @param $begin_time
* @param $end_time
* @param $ids
* @param $notIds
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private function getStoreSort($params, $begin_time, $end_time, $ids)
private function getStoreSort($params, $begin_time, $end_time, $ids,$notIds = "")
{
$storeModel = new AStore();
$fields = "a.id,a.store_name,SUM(b.performance) as performance";
//$params["a.id"] = array("not in","5288,3742,5292");
//查询出有业绩的经纪人
$have_performance_arr = $storeModel->getStoreListByPK($fields, $params);
//查询出无业绩的经纪人
$arr = $storeModel->getStoreListByPk1($params["a.site_id"], $begin_time, $end_time,$ids);
$arr = $storeModel->getStoreListByPk1($params["a.site_id"], $begin_time, $end_time,$ids,$notIds);
return array_merge($have_performance_arr, $arr);
}
......
......@@ -301,11 +301,14 @@ class AStore extends BaseModel
//echo $this->getLastSql();
return $data;
}
public function getStoreListByPk1($siteId,$startTime,$endTime,$ids){
public function getStoreListByPk1($siteId,$startTime,$endTime,$ids,$notIds){
$str_ids = " ";
if($ids){
$str_ids = " and a.id in ($ids)";
}
if($notIds){
$str_ids .= " and a.id not in ($notIds) ";
}
$sql = "select aa.id,aa.store_name,aa.performance from
(select a.id,a.store_name,0.00 as performance from a_store a
......
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