Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aic_duty_strategy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yinxiaoling
aic_duty_strategy
Commits
d04e47ca
Commit
d04e47ca
authored
May 20, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
间隔时间错误
parent
c9ab930b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
StrategyService.php
app/Service/StrategyService.php
+3
-5
No files found.
app/Service/StrategyService.php
View file @
d04e47ca
...
@@ -196,9 +196,9 @@ class StrategyService
...
@@ -196,9 +196,9 @@ class StrategyService
$insertTemp
[
'updated_at'
]
=
$now
;
$insertTemp
[
'updated_at'
]
=
$now
;
$insertData
[]
=
$insertTemp
;
$insertData
[]
=
$insertTemp
;
}
}
Log
::
channel
(
'api'
)
->
info
(
var_export
(
$insertData
,
true
));
//
Log::channel('api')->info(var_export($insertData,true));
$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
,
'startDay'
=>
date
(
'Y-m-d'
,
strtotime
(
"+1 day"
))];
$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
...
@@ -214,7 +214,6 @@ class StrategyService
...
@@ -214,7 +214,6 @@ class StrategyService
//跟进策略任务数据生成待新建任务的excel数据,(两种情况 一、有新数据时当时生成,二、每月1号生成)$operaterType类型 1为每月1号生成,0是按照当前日期计算
//跟进策略任务数据生成待新建任务的excel数据,(两种情况 一、有新数据时当时生成,二、每月1号生成)$operaterType类型 1为每月1号生成,0是按照当前日期计算
public
function
createTaskDataJob
(
$strategySn
,
$startDay
=
''
){
public
function
createTaskDataJob
(
$strategySn
,
$startDay
=
''
){
//set_time_limit(0);
//set_time_limit(0);
if
(
empty
(
$strategyInfo
)){
if
(
empty
(
$strategyInfo
)){
$strategyInfo
=
StrategySet
::
where
(
'strategy_sn'
,
$strategySn
)
->
first
()
->
toArray
();
$strategyInfo
=
StrategySet
::
where
(
'strategy_sn'
,
$strategySn
)
->
first
()
->
toArray
();
}
}
...
@@ -227,7 +226,6 @@ class StrategyService
...
@@ -227,7 +226,6 @@ class StrategyService
//一天呼叫两次类型,拆分时间,拆分项目
//一天呼叫两次类型,拆分时间,拆分项目
$call_time
=
explode
(
"#"
,
$strategyInfo
[
'call_time_set'
]);
$call_time
=
explode
(
"#"
,
$strategyInfo
[
'call_time_set'
]);
$project_sn
=
explode
(
"#"
,
$strategyInfo
[
'project_sn'
]);
$project_sn
=
explode
(
"#"
,
$strategyInfo
[
'project_sn'
]);
$tempi
=
0
;
$tempi
=
0
;
////每天、一天两次,两个时间点、一个话术或者两个话术;日期前一天和当天、一天一次, 一个时间点两个话术
////每天、一天两次,两个时间点、一个话术或者两个话术;日期前一天和当天、一天一次, 一个时间点两个话术
if
(
$strategyInfo
[
'day_type'
]
==
0
&&
$strategyInfo
[
'frequency_type'
]
==
2
){
//每天拨打,一天两次
if
(
$strategyInfo
[
'day_type'
]
==
0
&&
$strategyInfo
[
'frequency_type'
]
==
2
){
//每天拨打,一天两次
...
@@ -237,7 +235,7 @@ class StrategyService
...
@@ -237,7 +235,7 @@ class StrategyService
}
}
//这个月最后一天日期
//这个月最后一天日期
$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'
,
strtotime
(
$startDay
)
)
+
1
;
$doubleTotal
=
$doubleTotal
*
$day
;
$doubleTotal
=
$doubleTotal
*
$day
;
for
(
$i
=
$startDay
;
$i
<=
$endDay
;
$i
=
date
(
"Y-m-d"
,
strtotime
(
"+1 day"
,
strtotime
(
$i
)))){
for
(
$i
=
$startDay
;
$i
<=
$endDay
;
$i
=
date
(
"Y-m-d"
,
strtotime
(
"+1 day"
,
strtotime
(
$i
)))){
foreach
(
$data
as
$k
=>
$v
){
foreach
(
$data
as
$k
=>
$v
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment