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
3deb84a9
Commit
3deb84a9
authored
May 20, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机号正则修改
parent
d1bdc475
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
StrategyTaskController.php
app/Http/Controllers/strategy/StrategyTaskController.php
+1
-1
StrategyService.php
app/Service/StrategyService.php
+3
-3
No files found.
app/Http/Controllers/strategy/StrategyTaskController.php
View file @
3deb84a9
...
@@ -85,7 +85,7 @@ class StrategyTaskController extends Controller
...
@@ -85,7 +85,7 @@ class StrategyTaskController extends Controller
$callTime
=
$request
->
call_time
;
$callTime
=
$request
->
call_time
;
$validator
=
Validator
::
make
(
$request
->
all
(),
[
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'phone'
=>
'required|regex:/^1[3-
8
]{1}[0-9]{9}$/'
,
'phone'
=>
'required|regex:/^1[3-
9
]{1}[0-9]{9}$/'
,
'user_sn'
=>
'required'
,
'user_sn'
=>
'required'
,
'call_time'
=>
'required'
,
'call_time'
=>
'required'
,
'name'
=>
'max:20'
'name'
=>
'max:20'
...
...
app/Service/StrategyService.php
View file @
3deb84a9
...
@@ -68,7 +68,7 @@ class StrategyService
...
@@ -68,7 +68,7 @@ class StrategyService
$failData
[]
=
$v
;
$failData
[]
=
$v
;
$dataLab
=
0
;
$dataLab
=
0
;
}
}
if
(
$dataLab
==
1
&&
!
preg_match
(
'/^1[3-
8
]{1}[0-9]{9}$/'
,
$v
[
1
])){
//手机号格式验证(手机号码验证以13、14、15、16、17、18开头的11位数字),不能为空
if
(
$dataLab
==
1
&&
!
preg_match
(
'/^1[3-
9
]{1}[0-9]{9}$/'
,
$v
[
1
])){
//手机号格式验证(手机号码验证以13、14、15、16、17、18开头的11位数字),不能为空
array_push
(
$v
,
"手机号格式不正确"
);
array_push
(
$v
,
"手机号格式不正确"
);
$failData
[]
=
$v
;
$failData
[]
=
$v
;
$dataLab
=
0
;
$dataLab
=
0
;
...
@@ -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
];
$jobParams
=
[
'strategySn'
=>
$strategySn
];
// /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
...
...
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