Commit 63e6cfb1 authored by zw's avatar zw

bug

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