Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
clubAdmin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
clubAdmin
Commits
2fd46a8b
Commit
2fd46a8b
authored
Aug 02, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警接口
parent
12187a61
Pipeline
#2075
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
app/Services/Warn/WarnService.php
app/Services/Warn/WarnService.php
+24
-2
No files found.
app/Services/Warn/WarnService.php
View file @
2fd46a8b
...
...
@@ -349,6 +349,7 @@ class WarnService implements IWarnService
$platformArr
=
config
(
env
(
'ENVIRONMENT'
)
.
'.PLATFORM'
);
$channelArr
=
config
(
env
(
'ENVIRONMENT'
)
.
'.CHANNEL'
);
$idArr
=
[];
foreach
(
$lists
as
$list
)
{
$tem
[
'id'
]
=
$list
->
id
;
$tem
[
'platform'
]
=
$platformArr
[
$list
->
platform
]
??
''
;
...
...
@@ -357,8 +358,8 @@ class WarnService implements IWarnService
$tem
[
'oneWithdrawal'
]
=
0.00
;
$tem
[
'dayWithdrawal'
]
=
0.00
;
$tem
[
'userDayWithdrawal'
]
=
0.00
;
$tem
[
'configId'
]
=
$list
->
config_id
;
$tem
[
'peopleId'
]
=
$list
->
people_id
;
$tem
[
'configId'
]
=
$list
->
config_id
;
$tem
[
'peopleId'
]
=
$list
->
people_id
;
$tem
[
'status'
]
=
$list
->
status
;
$statusName
=
'已发送'
;
if
(
$list
->
status
==
0
)
$statusName
=
'未发送'
;
...
...
@@ -366,7 +367,28 @@ class WarnService implements IWarnService
$tem
[
'msg'
]
=
$list
->
msg
;
$tem
[
'createdAt'
]
=
$list
->
send_time
;
$array
[
'data'
][]
=
$tem
;
$idArr
[
$list
->
config_id
]
=
$list
->
config_id
;
}
if
(
!
empty
(
$idArr
)){
$conArr
=
[];
$configs
=
WarnConfigModel
::
whereIn
(
'id'
,
$idArr
)
->
select
(
'id'
,
'one_withdrawal'
,
'day_withdrawal'
,
'people_day_withdrawal'
)
->
get
();
foreach
(
$configs
as
$con
){
$ctem
[
'oneWithdrawal'
]
=
sprintf
(
'%.2f'
,
$con
->
one_withdrawal
/
100
);
$ctem
[
'dayWithdrawal'
]
=
sprintf
(
'%.2f'
,
$con
->
day_withdrawal
/
100
);
$ctem
[
'userDayWithdrawal'
]
=
sprintf
(
'%.2f'
,
$con
->
people_day_withdrawal
/
100
);
$conArr
[
$con
->
id
]
=
$ctem
;
}
if
(
!
empty
(
$conArr
)){
foreach
(
$array
[
'data'
]
as
&
$val
){
$val
[
'oneWithdrawal'
]
=
$conArr
[
$val
[
'configId'
]][
'oneWithdrawal'
]
??
0.00
;
$val
[
'dayWithdrawal'
]
=
$conArr
[
$val
[
'configId'
]][
'dayWithdrawal'
]
??
0.00
;
$val
[
'userDayWithdrawal'
]
=
$conArr
[
$val
[
'configId'
]][
'userDayWithdrawal'
]
??
0.00
;
}
}
}
unset
(
$lists
,
$list
);
return
$array
;
}
...
...
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