Commit c846d708 authored by yinxiaoling's avatar yinxiaoling

策略创建当天不新建任务

parent d94b28f0
...@@ -33,6 +33,7 @@ class StrategyTaskJob implements ShouldQueue ...@@ -33,6 +33,7 @@ class StrategyTaskJob implements ShouldQueue
{ {
$StrategyService = new StrategyService(); $StrategyService = new StrategyService();
$StrategyService->createTaskDataJob($this->paramsArr['strategySn']); $startDay = isset($this->paramsArr['startDay']) ? $this->paramsArr['startDay'] : '';
$StrategyService->createTaskDataJob($this->paramsArr['strategySn'],$startDay);
} }
} }
...@@ -200,7 +200,7 @@ class StrategyService ...@@ -200,7 +200,7 @@ class StrategyService
$insertExcelReturn = StrategyExcel::insert($insertData); $insertExcelReturn = StrategyExcel::insert($insertData);
Log::channel('api')->info($insertExcelReturn); Log::channel('api')->info($insertExcelReturn);
if ($insertExcelReturn){//创建任务数据,这一步剥离出来,不然接口返回太慢,方案==,使用队列处理 if ($insertExcelReturn){//创建任务数据,这一步剥离出来,不然接口返回太慢,方案==,使用队列处理
$jobParams = ['strategySn'=>$strategySn]; $jobParams = ['strategySn'=>$strategySn,'startDay'=>date('Y-m-d',strtotime("+1 day"))];
// /opt/lampp/bin/php /opt/lampp/xiaoa/xiaoa-aic/artisan queue:work --queue=StrategyTask --sleep=3 --tries=0 --daemon --timeout=90 // /opt/lampp/bin/php /opt/lampp/xiaoa/xiaoa-aic/artisan queue:work --queue=StrategyTask --sleep=3 --tries=0 --daemon --timeout=90
$job = (new StrategyTaskJob($jobParams))->onQueue('StrategyTask'); $job = (new StrategyTaskJob($jobParams))->onQueue('StrategyTask');
dispatch($job); dispatch($job);
...@@ -212,7 +212,7 @@ class StrategyService ...@@ -212,7 +212,7 @@ class StrategyService
} }
//跟进策略任务数据生成待新建任务的excel数据,(两种情况 一、有新数据时当时生成,二、每月1号生成)$operaterType类型 1为每月1号生成,0是按照当前日期计算 //跟进策略任务数据生成待新建任务的excel数据,(两种情况 一、有新数据时当时生成,二、每月1号生成)$operaterType类型 1为每月1号生成,0是按照当前日期计算
public function createTaskDataJob($strategySn){ public function createTaskDataJob($strategySn,$startDay=''){
//set_time_limit(0); //set_time_limit(0);
if (empty($strategyInfo)){ if (empty($strategyInfo)){
...@@ -232,7 +232,9 @@ class StrategyService ...@@ -232,7 +232,9 @@ class StrategyService
////每天、一天两次,两个时间点、一个话术或者两个话术;日期前一天和当天、一天一次, 一个时间点两个话术 ////每天、一天两次,两个时间点、一个话术或者两个话术;日期前一天和当天、一天一次, 一个时间点两个话术
if ($strategyInfo['day_type'] == 0 && $strategyInfo['frequency_type'] == 2){//每天拨打,一天两次 if ($strategyInfo['day_type'] == 0 && $strategyInfo['frequency_type'] == 2){//每天拨打,一天两次
$doubleTotal = $total*2; $doubleTotal = $total*2;
$startDay = date('Y-m-d'); //执行当天时间 if (empty($startDay)){
$startDay = date('Y-m-d'); //执行当天时间
}
//这个月最后一天日期 //这个月最后一天日期
$endDay = date('Y-m-d',strtotime("-1 day",strtotime("+1 month",strtotime(date('Y-m-01'))))); $endDay = date('Y-m-d',strtotime("-1 day",strtotime("+1 month",strtotime(date('Y-m-01')))));
$day = date('j',strtotime($endDay)) - date('j') + 1; $day = date('j',strtotime($endDay)) - date('j') + 1;
......
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