Commit 2c5732a8 authored by clone's avatar clone

bug

parent 370629d4
...@@ -198,7 +198,7 @@ Route::group('index', [ ...@@ -198,7 +198,7 @@ Route::group('index', [
'reportListTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 2 ] ], //财务 成交报告-未结单-第二级审核 'reportListTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 2 ] ], //财务 成交报告-未结单-第二级审核
'reportListThree/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 3 ] ], //财务 成交报告-未结单-第三级审核 'reportListThree/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 3 ] ], //财务 成交报告-未结单-第三级审核
'reportListStatement/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 4 ] ], //财务 成交报告-已结单 'reportListStatement/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 4 ] ], //财务 成交报告-已结单
'backOutToOne' => [ 'index/Finance/backOutToOne', [ 'method' => 'POST' ]], //财务 成交报告-撤销成交报告 'backOutToOne' => [ 'index/Finance/backOutToOne', [ 'method' => 'POST' ] ], //财务 成交报告-撤销成交报告
'backOutOne/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 5 ] ], //财务 成交报告-待撤销-第一级数据 'backOutOne/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 5 ] ], //财务 成交报告-待撤销-第一级数据
'backOutTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 7 ] ], //财务 成交报告-待撤销-第二级数据 'backOutTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 7 ] ], //财务 成交报告-待撤销-第二级数据
'backOutThree/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 8 ] ], //财务 成交报告-待撤销-第三级数据 'backOutThree/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 8 ] ], //财务 成交报告-待撤销-第三级数据
...@@ -285,8 +285,6 @@ Route::group('index', [ ...@@ -285,8 +285,6 @@ Route::group('index', [
'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志 'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志
'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志 'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志
...@@ -297,7 +295,6 @@ Route::group('index', [ ...@@ -297,7 +295,6 @@ Route::group('index', [
'getPerformanceExcel' => [ 'index/Performance/getPerformanceExcel', [ 'method' => 'POST|GET' ] ], 'getPerformanceExcel' => [ 'index/Performance/getPerformanceExcel', [ 'method' => 'POST|GET' ] ],
]); ]);
...@@ -413,6 +410,7 @@ Route::group('task', [ ...@@ -413,6 +410,7 @@ Route::group('task', [
'totalAgentResults_new' => [ 'task/ResultsSummaryTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计 'totalAgentResults_new' => [ 'task/ResultsSummaryTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计
'totalAgentResults' => [ 'task/ResultsSummaryNewTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计 'totalAgentResults' => [ 'task/ResultsSummaryNewTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计
'totalAgentResultsByTime' => [ 'task/ResultsSummaryNewTask/totalAgentResultsByTime', [ 'method' => 'get' ] ], //业绩统计
'updateTotalByAgentId' => [ 'task/ResultsSummaryNewTask/updateTotalByAgentId', [ 'method' => 'get' ] ], //业绩统计 'updateTotalByAgentId' => [ 'task/ResultsSummaryNewTask/updateTotalByAgentId', [ 'method' => 'get' ] ], //业绩统计
......
...@@ -12,6 +12,7 @@ use app\model\OPayLogModel; ...@@ -12,6 +12,7 @@ use app\model\OPayLogModel;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\TAgentTotalModel; use app\model\TAgentTotalModel;
use app\model\Users; use app\model\Users;
use Think\Log;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -79,6 +80,31 @@ class ResultsSummaryNewTask ...@@ -79,6 +80,31 @@ class ResultsSummaryNewTask
unset($this->payLogModel); unset($this->payLogModel);
}
public function totalAgentResultsByTime()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
$total_time = $_GET["total_time"];
$total = $this->agentsModel->getAgentsCountByTask();
$pageSize = 20;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$resultArr = $this->agentsModel->getAgentsListByTask($pageNo, $pageSize, "id,store_id,district_id");
$this->executeTotal($resultArr, $total_time);
unset($resultArr);
}
unset($this->agentsModel);
unset($this->tAgentTotalModel);
unset($this->houseModel);
unset($this->userModel);
unset($this->bargainModel);
unset($this->reportModel);
unset($this->marchInModel);
unset($this->payLogModel);
} }
/** /**
...@@ -87,7 +113,7 @@ class ResultsSummaryNewTask ...@@ -87,7 +113,7 @@ class ResultsSummaryNewTask
* @param $district_id * @param $district_id
* @param $total_time string 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天 * @param $total_time string 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
*/ */
public function updateTotalByAgentId($agent_id,$store_id,$district_id,$total_time) public function updateTotalByAgentId($agent_id, $store_id, $district_id, $total_time)
{ {
$params[0]["id"] = $agent_id; $params[0]["id"] = $agent_id;
$params[0]["store_id"] = $store_id; $params[0]["store_id"] = $store_id;
...@@ -123,10 +149,12 @@ class ResultsSummaryNewTask ...@@ -123,10 +149,12 @@ class ResultsSummaryNewTask
if (count($total_time_arr) > 0) { if (count($total_time_arr) > 0) {
$id = $total_time_arr[0]["id"]; $id = $total_time_arr[0]["id"];
} }
if (empty($value["id"]) || empty($value["district_id"]) || empty($value["store_id"])) {
$agent_id = empty($value["id"]) ? 0 : $value["id"]; continue;
$district_id = empty($value["district_id"]) ? 0 : $value["district_id"]; }
$store_id = empty($value["store_id"]) ? 0 : $value["store_id"]; $agent_id = $value["id"];
$district_id = $value["district_id"];
$store_id = $value["store_id"];
//todo 查询时间段的数据 //todo 查询时间段的数据
$result = $this->selectTotal($agent_id, $district_id, $store_id, $start_total_time, $end_total_time); $result = $this->selectTotal($agent_id, $district_id, $store_id, $start_total_time, $end_total_time);
...@@ -142,7 +170,6 @@ class ResultsSummaryNewTask ...@@ -142,7 +170,6 @@ class ResultsSummaryNewTask
unset($result); unset($result);
} }
if (count($insertArr) > 0) { if (count($insertArr) > 0) {
$this->tAgentTotalModel->addTotal($insertArr); $this->tAgentTotalModel->addTotal($insertArr);
} }
......
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