Commit 595699d8 authored by zhuwei's avatar zhuwei

1

parent f0df18d6
...@@ -60,11 +60,12 @@ class Performance extends Basic ...@@ -60,11 +60,12 @@ class Performance extends Basic
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$params); $list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$params);
//dump($list); //dump($list);
if (count($list) > 0) { if (count($list) > 0) {
$result["list"] = $list['list']; $result["list"] = $list['list'];
$result["total"] = $list['total']; $result["total"] = $list['total'];
$result["performance_total"] = $list['performance_total']; $result["performance_total"] = $list['performance_total'];
$result["official_receipts_total"] = $list['official_receipts_total'];
$result["start_time"] = $start_day; $result["start_time"] = $start_day;
$result["end_time"] = $end_day; $result["end_time"] = $end_day;
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} }
return $this->response("200", "request null"); return $this->response("200", "request null");
......
...@@ -51,14 +51,15 @@ class PerformanceService ...@@ -51,14 +51,15 @@ class PerformanceService
/** /**
* @param $agent_id * 业绩排行
* @param $type * @param $type
* @param $yesterday * @param $yesterday
* @param $end_day * @param $end_day
* @param $pageNo
* @param $pageSize
* @param $father_id
* @param $params
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function totalAgent($type, $yesterday, $end_day,$pageNo,$pageSize,$father_id,$params) public function totalAgent($type, $yesterday, $end_day,$pageNo,$pageSize,$father_id,$params)
{ {
...@@ -124,6 +125,9 @@ class PerformanceService ...@@ -124,6 +125,9 @@ class PerformanceService
} }
/*计算总业绩 end*/ /*计算总业绩 end*/
//计算总实收
$official_receipts_total = $this->getOfficialReceiPtsTotal($where_,$type);
$arr = []; $arr = [];
$num = ($pageNo - 1) * $pageSize; $num = ($pageNo - 1) * $pageSize;
...@@ -180,7 +184,24 @@ class PerformanceService ...@@ -180,7 +184,24 @@ class PerformanceService
$ranking_num = $this->getRanking($type, $yesterday, $end_day, $pageNo, $pageSize, $params, $agent_id); $ranking_num = $this->getRanking($type, $yesterday, $end_day, $pageNo, $pageSize, $params, $agent_id);
$result[0]['index_'] = $ranking_num; $result[0]['index_'] = $ranking_num;
} }
return [ 'list' => $result, 'total' => $total_result, 'performance_total' => $sum_result_num ]; return [ 'list' => $result, 'total' => $total_result, 'performance_total' => $sum_result_num,
'official_receipts_total' => $official_receipts_total ];
}
/**
* 计算总的实收
* @param $where_
* @param $type
* @return int
*/
public function getOfficialReceiPtsTotal($where_,$type){
$field = "sum(official_receipts) as official_receipts_total";
$sum_result = $this->totalModel->getTotalByAgentIdForPcPerformanceSum($field, $where_, $type);
$total = 0;
foreach ($sum_result as $k1 => $v1) {
$total += $v1['official_receipts_total'];
}
return $total;
} }
/** /**
......
...@@ -316,6 +316,8 @@ class UserLogService ...@@ -316,6 +316,8 @@ class UserLogService
$result['first_login_time'] = $user_result['first_login_time']; $result['first_login_time'] = $user_result['first_login_time'];
// 客户来源 // 客户来源
$result['source_intro'] = $user_result['source_intro']; $result['source_intro'] = $user_result['source_intro'];
$result['concrete_industry'] = $user_result['concrete_industry'];
$result['weixin_nick'] = $user_result['weixin_nick'];
return $result; 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