Commit 75d7fcd0 authored by clone's avatar clone

业绩模块

parent db00b150
...@@ -101,10 +101,10 @@ class Performance extends Basic ...@@ -101,10 +101,10 @@ class Performance extends Basic
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 8882, "agent_id" => 10014,
"start_time" => "2018-04-04", "start_time" => "2018-04-11",
"end_time" => "2018-04-04", "end_time" => "2018-04-11",
);*/ );*/
try { try {
......
...@@ -79,7 +79,7 @@ class Basic extends Controller ...@@ -79,7 +79,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1]; $requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify(); // $this->tokenVerify();
// $this->userAuth(trim($requestPath)); // $this->userAuth(trim($requestPath));
} }
unset($this->params["AuthToken"]); unset($this->params["AuthToken"]);
......
...@@ -306,7 +306,7 @@ class PerformanceService ...@@ -306,7 +306,7 @@ class PerformanceService
public function storePerformance($agent_id, $start_time, $end_time) public function storePerformance($agent_id, $start_time, $end_time)
{ {
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", [ "id" => $agent_id ]); $result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", [ "id" => $agent_id ]);
// dump($result);
if (count($result) <= 0) { if (count($result) <= 0) {
return null; return null;
} }
...@@ -323,10 +323,16 @@ class PerformanceService ...@@ -323,10 +323,16 @@ class PerformanceService
$list = []; $list = [];
$now_date = date("Y-m-d", time()); $now_date = date("Y-m-d", time());
if ($start_time == $now_date && $end_time == $now_date) { if ($start_time == $now_date && $end_time == $now_date) {
$verify = new VerifyService();
$agent_ids = $verify->getAgentsByAgentId($agent_id);
$params["agent_id"] = array("in",$agent_ids);
$params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$list = $this->sumDistrictPerformance($params); $list = $this->sumDistrictPerformance($params);
// dump($list);exit;
} else { } else {
$field = "sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num, $field = "sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num, sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
......
...@@ -366,7 +366,7 @@ class AAgents extends BaseModel ...@@ -366,7 +366,7 @@ class AAgents extends BaseModel
public function getAgentsListByTask($pageNo = 1, $pageSize = 15, $field = "id") public function getAgentsListByTask($pageNo = 1, $pageSize = 15, $field = "id")
{ {
return Db::table($this->table) return Db::table($this->table)
->field("id") ->field($field)
->select(); ->select();
} }
......
...@@ -87,7 +87,7 @@ class TAgentTotalModel extends Model ...@@ -87,7 +87,7 @@ class TAgentTotalModel extends Model
->group($group_) ->group($group_)
->order($order) ->order($order)
->select(); ->select();
//echo $this->db_->getLastSql(); echo $this->db_->getLastSql();
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