Commit 75d7fcd0 authored by clone's avatar clone

业绩模块

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