Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
20234952
...
20234952937b2cab70339c233f3e345912958151
authored
2021-09-15 10:11:53 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
同步数据
1 parent
a51ec45c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
17 deletions
app/Jobs/StakeholderIncomeSyncJob.php
app/Jobs/StakeholderIncomeSyncJob.php
View file @
2023495
...
...
@@ -75,31 +75,40 @@ class StakeholderIncomeSyncJob implements ShouldQueue
'title'
=>
"
{
$bills
->
bill_section_start
}
-
{
$bills
->
bill_section_end
}
账单/
{
$channel
}
"
,
];
$http_res
=
ApiService
::
walletAddIncome
(
$http_data
);
if
(
$res
=
StakeholderIncomeByPayer
::
query
()
->
where
([
'serial_no'
=>
$income_item
[
'serial_no'
]])
->
first
())
{
if
(
empty
(
$http_res
))
{
//重试 401/403/403
Log
::
channel
(
'api'
)
->
warning
(
__METHOD__
.
"streamid:
{
$id
}
-api请求失败"
,
[
'income_item'
=>
$income_item
,
'http_data'
=>
$http_data
]);
}
else
{
if
(
$res
[
'sync_status'
]
==
0
)
{
$update
=
[
'http_log'
=>
json_encode
(
$http_res
,
JSON_UNESCAPED_UNICODE
),
'busi_id'
=>
$http_res
[
'data'
][
'busiId'
],
];
//直接未同步的数据才请求api
$http_res
=
ApiService
::
walletAddIncome
(
$http_data
);
if
(
$http_res
[
'code'
]
==
0
)
{
$update
[
'sync_status'
]
=
1
;
}
else
{
$update
[
'sync_status'
]
=
2
;
}
if
(
empty
(
$http_res
))
{
//重试 401/403/403
Log
::
channel
(
'api'
)
->
warning
(
__METHOD__
.
"streamid:
{
$id
}
-api请求失败"
,
[
'income_item'
=>
$income_item
,
'http_data'
=>
$http_data
]);
}
else
{
$update
=
[
'http_log'
=>
json_encode
(
$http_res
,
JSON_UNESCAPED_UNICODE
),
'busi_id'
=>
$http_res
[
'data'
][
'busiId'
],
];
if
(
$http_res
[
'code'
]
==
0
)
{
$update
[
'sync_status'
]
=
1
;
}
else
{
$update
[
'sync_status'
]
=
2
;
}
//记录请求api返回体并修改状态
if
(
StakeholderIncomeByPayer
::
query
()
->
where
([
'serial_no'
=>
$income_item
[
'serial_no'
]])
->
update
(
$update
))
{
//记录请求api返回体并修改状态
if
(
StakeholderIncomeByPayer
::
query
()
->
where
([
'serial_no'
=>
$income_item
[
'serial_no'
]])
->
update
(
$update
))
{
$redis
->
xdel
(
$key
,
[
$id
]);
}
}
}
else
{
$redis
->
xdel
(
$key
,
[
$id
]);
}
}
}
}
}
}
...
...
Please
register
or
sign in
to post a comment