Commit 23d32e61 authored by zhuwei's avatar zhuwei

1

parent 2e9b0e37
......@@ -54,15 +54,20 @@ class Performance extends Basic
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day, $params["site_id"]);
$all_performance_total = $all_official_receipts_total = 0;
foreach ($list as $key => $value) {
$all_performance_total += $value['performance_total'];
$all_official_receipts_total += $value['official_receipts_total'];
}
if (count($list) > 0) {
$result["list"] = $list;
$result["start_time"] = $start_day;
$result["end_time"] = $end_day;
$result["is_boss"] = 0;
$vip = new VipService();//0:有权限 1:无权限
$result["is_boss"]= $vip->checkRule($params["agent_id"], 'boss');
$result["is_boss"] = $vip->checkRule($params["agent_id"], 'boss');
$result["all_performance_total"] = $all_performance_total;
$result["all_official_receipts_total"] = $all_official_receipts_total;
return $this->response("200", "request success", $result);
}
return $this->response("200", "request null");
......
......@@ -76,7 +76,12 @@ class PerformanceService
$where_['d.site_id'] = $site_id;
$where_['a.total_time'] = array( 'between', array( $yesterday, $end_day ) );
$field = "a.agent_id,a.store_id,a.district_id,sum(a.performance) as performance_total";
$field = " a.agent_id,
a.store_id,
a.district_id,
sum(a.performance) as performance_total,
sum(a.official_receipts) as official_receipts_total
";
$order = "performance_total desc";
$result = $this->totalModel->getTotalByAgentIdSite($field, $where_, $type, $order);
//dump($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