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
d2c02e44
Commit
d2c02e44
authored
May 16, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务数据列表
parent
d2a754bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
16 deletions
+41
-16
StrategySetController.php
app/Http/Controllers/strategy/StrategySetController.php
+5
-5
StrategyTaskController.php
app/Http/Controllers/strategy/StrategyTaskController.php
+36
-11
No files found.
app/Http/Controllers/strategy/StrategySetController.php
View file @
d2c02e44
...
...
@@ -35,7 +35,7 @@ class StrategySetController extends Controller
$v
[
'frequency_type_name'
]
=
$v
[
'frequency_type'
]
==
1
?
'一天一次'
:
'一天两次'
;
$listInfo
[]
=
$v
;
}
return
$this
->
successWithInfo
(
[
'data'
=>
$listInfo
]
);
return
$this
->
successWithInfo
(
$listInfo
);
}
public
function
store
(
Request
$request
,
StrategyService
$StrategyService
){
...
...
@@ -92,7 +92,7 @@ class StrategySetController extends Controller
}
//返回成功数、失败数、失败导出文件
$returnArr
=
compact
(
'total'
,
'successTotal'
,
'failTotal'
,
'failDataFile'
);
return
$this
->
successWithInfo
(
[
'data'
=>
$returnArr
]
);
return
$this
->
successWithInfo
(
$returnArr
);
}
//删除策略
public
function
destroy
(
$strategySn
){
...
...
@@ -107,12 +107,12 @@ class StrategySetController extends Controller
//项目列表
public
function
getProjectsList
(){
$projectInfo
=
$this
->
getAllowProjects
(
0
);
return
$this
->
successWithInfo
(
[
'data'
=>
$projectInfo
]
);
return
$this
->
successWithInfo
(
$projectInfo
);
}
//主叫号码列表
public
function
getCallNumberList
(){
$callNumbnerInfo
=
$this
->
getAllowCallNumber
();
return
$this
->
successWithInfo
(
[
'data'
=>
$callNumbnerInfo
]
);
return
$this
->
successWithInfo
(
$callNumbnerInfo
);
}
//下载模板及下载导入失败excel数据
...
...
@@ -189,7 +189,7 @@ class StrategySetController extends Controller
//返回成功数、失败数、失败导出文件
$returnArr
=
compact
(
'total'
,
'successTotal'
,
'failTotal'
,
'failDataFile'
);
return
$this
->
successWithInfo
(
[
'data'
=>
$returnArr
]
);
return
$this
->
successWithInfo
(
$returnArr
);
}
else
{
return
$this
->
errorWithInfo
(
'请选择导入文件'
,
401
);
}
...
...
app/Http/Controllers/strategy/StrategyTaskController.php
View file @
d2c02e44
...
...
@@ -15,20 +15,45 @@ class StrategyTaskController extends Controller
public
function
index
(){
//搜索分页?
$pageSize
=
request
()
->
pageSize
;
$projectArr
=
$this
->
getAllowProjects
(
1
);
$strategyInfo
=
StrategyTask
::
all
()
->
toArray
();
$listInfo
=
[];
foreach
(
$strategyInfo
as
$k
=>
$v
){
$projectSnTemp
=
explode
(
"#"
,
$v
[
'project_sn'
]);
$v
[
'project_name'
]
=
isset
(
$projectArr
[
$projectSnTemp
[
0
]])
?
$projectArr
[
$projectSnTemp
[
0
]]
:
''
;
if
(
isset
(
$projectSnTemp
[
1
])
&&
isset
(
$projectArr
[
$projectSnTemp
[
1
]])){
$v
[
'project_name'
]
.=
$projectArr
[
$projectSnTemp
[
1
]];
//$strategyInfo = StrategyTask::all()->toArray();
$searchArr
=
[];
$searchArr
[
'phone'
]
=
request
()
->
phone
;
$searchArr
[
'is_created'
]
=
request
()
->
is_created
;
$searchArr
[
'callTimeStart'
]
=
request
()
->
started_at
;
$searchArr
[
'callTimeStop'
]
=
request
()
->
stoped_at
;
$strategyInfo
=
StrategyTask
::
where
(
function
(
$query
)
use
(
$searchArr
){
if
(
isset
(
$searchArr
[
'phone'
])
&&
!
empty
(
$searchArr
[
'phone'
])){
$query
->
where
(
'phone'
,
'like'
,
"%
{
$searchArr
[
'phone'
]
}
%"
);
}
if
(
isset
(
$searchArr
[
'is_created'
])
&&
!
empty
(
$searchArr
[
'is_created'
])){
$query
->
where
(
'is_created'
,
'like'
,
"%
{
$searchArr
[
'is_created'
]
}
%"
);
}
if
(
isset
(
$searchArr
[
'callTimeStart'
])
&&
!
empty
(
$searchArr
[
'callTimeStart'
])){
$query
->
whereRaw
(
" call_date || ' ' || call_time >= '
{
$searchArr
[
'callTimeStart'
]
}
'"
);
}
$v
[
'is_created_name'
]
=
$v
[
'is_created'
]
==
0
?
'未建'
:
'已建'
;
$listInfo
[]
=
$v
;
if
(
isset
(
$searchArr
[
'callTimeStop'
])
&&
!
empty
(
$searchArr
[
'callTimeStop'
])){
$query
->
whereRaw
(
" call_date || ' ' || call_time <= '
{
$searchArr
[
'callTimeStart'
]
}
'"
);
}
});
if
(
empty
(
$pageSize
)){
$strategyInfo
=
$strategyInfo
->
get
()
->
toArray
();
}
else
{
$strategyInfo
=
$strategyInfo
->
paginate
(
$pageSize
)
->
toArray
();
}
$listInfo
=
[];
foreach
(
$strategyInfo
[
'data'
]
as
$k
=>
$v
){
$strategyInfo
[
'data'
][
$k
][
'project_name'
]
=
isset
(
$projectArr
[
$v
[
'project_sn'
]])
?
$projectArr
[
$v
[
'project_sn'
]]
:
''
;
$strategyInfo
[
'data'
][
$k
][
'is_created_name'
]
=
$v
[
'is_created'
]
==
0
?
'未建'
:
'已建'
;
}
return
$this
->
successWithInfo
(
[
'data'
=>
$listInfo
]
);
return
$this
->
successWithInfo
(
$strategyInfo
);
}
...
...
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