Commit 80a27a0c authored by zhuwei's avatar zhuwei

业绩加总条数

parent b1b0abc2
...@@ -89,6 +89,7 @@ class PerformanceService ...@@ -89,6 +89,7 @@ class PerformanceService
$result = $this->totalModel->getTotalByAgentId($field, $where_, $type, $order); $result = $this->totalModel->getTotalByAgentId($field, $where_, $type, $order);
//dump($result); //dump($result);
$arr = []; $arr = [];
$arr['total'] = $this->totalModel->getTotalByAgentIdCount($field, $where_, $type, $order);
$field = "a.name,a.img,b.store_name,c.district_name"; $field = "a.name,a.img,b.store_name,c.district_name";
//dump($result); //dump($result);
$ranking_num = $request_source_type == 0 ? 5 : 100 ;//App显示前5 PC后台显示前100 $ranking_num = $request_source_type == 0 ? 5 : 100 ;//App显示前5 PC后台显示前100
......
...@@ -92,6 +92,32 @@ class TAgentTotalModel extends Model ...@@ -92,6 +92,32 @@ class TAgentTotalModel extends Model
} }
public function getTotalByAgentIdCount($field ,$params, $type ,$order = "")
{
$group_ = "";
switch ($type) {
case 1:
$group_ = "agent_id";
break;
case 2:
$group_ = "store_id";
break;
case 3:
$group_ = "district_id";
break;
}
$result = $this->db_
->field($field)
->where($params)
->group($group_)
->order($order)
->count();
// echo $this->db_->getLastSql();
return $result;
}
......
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