Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
bp
goods
Commits
417366c5
Commit
417366c5
authored
Sep 09, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 团长分销-下单活动日期问题修复
parent
f862e8f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
Colonelwallet.php
application/modules/Job/controllers/Colonelwallet.php
+22
-20
PindanActivityInviteOrderService.php
...n/services/marketing/PindanActivityInviteOrderService.php
+2
-1
No files found.
application/modules/Job/controllers/Colonelwallet.php
View file @
417366c5
...
...
@@ -7,7 +7,6 @@
use
App\Base\Job
;
use
App\Models\marketing\mysql\ColonelDistributorPayInfo
;
use
App\Exception\custom\InterfaceException
;
use
Api\PhpUtils\Http\HttpUtil
;
use
Api\PhpUtils\Log\JobLog
;
...
...
@@ -21,8 +20,7 @@ class ColonelwalletController extends Job
/**
* Notes: 奖励结算脚本
* User: pengfei@yidian-inc.com
* Date: 2021/9/3 6:03 下午
* @throws InterfaceException
* Date: 2021/9/9 11:17 上午
*/
public
function
indexAction
()
{
...
...
@@ -30,14 +28,15 @@ class ColonelwalletController extends Job
$payInfoList
=
$this
->
getPayInfoList
();
$this
->
loggerInfo
(
'payInfoCount='
.
count
(
$payInfoList
));
if
(
!
empty
(
$payInfoList
))
{
if
(
$this
->
deductingInventory
(
$payInfoList
))
{
if
(
$this
->
toWallet
(
$payInfoList
))
{
if
(
$this
->
handlePayInfoStatus
(
array_column
(
$payInfoList
,
'pay_info_id'
)))
{
$this
->
loggerInfo
(
'success'
);
}
else
{
$this
->
loggerError
(
'更新状态失败'
);
try
{
if
(
$this
->
deductingInventory
(
$payInfoList
))
{
if
(
$this
->
toWallet
(
$payInfoList
))
{
$this
->
handlePayInfoStatus
(
array_column
(
$payInfoList
,
'pay_info_id'
));
}
}
$this
->
loggerInfo
(
'success'
);
}
catch
(
Exception
$e
)
{
$this
->
loggerError
(
'error:'
.
$e
->
getMessage
());
}
}
$this
->
loggerInfo
(
'end'
);
...
...
@@ -49,12 +48,12 @@ class ColonelwalletController extends Job
* Date: 2021/9/3 6:04 下午
* @param $payInfoList
* @return bool
* @throws
Interface
Exception
* @throws Exception
*/
private
function
toWallet
(
$payInfoList
)
:
bool
{
if
(
!
$url
=
config
(
'interface'
,
'wallet.account.transfer'
))
{
throw
new
InterfaceException
([
'cus'
=>
0
]
);
throw
new
Exception
(
'没有wallet.account.transfer配置'
);
}
$httpParams
=
self
::
getWalletHttpParams
();
$list
=
[];
...
...
@@ -77,8 +76,7 @@ class ColonelwalletController extends Job
$this
->
loggerInfo
(
'调用钱包服务成功,count='
.
count
(
$payInfoList
));
return
true
;
}
else
{
$this
->
loggerError
(
'调用钱包服务失败,httpParams='
.
json_encode
(
$httpParams
));
return
false
;
throw
new
Exception
(
'调用钱包服务失败,httpParams='
.
json_encode
(
$httpParams
));
}
}
...
...
@@ -89,12 +87,12 @@ class ColonelwalletController extends Job
* Date: 2021/9/3 6:04 下午
* @param $payInfoList
* @return bool
* @throws
Interface
Exception
* @throws Exception
*/
private
function
deductingInventory
(
$payInfoList
)
:
bool
{
if
(
!
$url
=
config
(
'interface'
,
'coupon.capitalpool.grant_user_amount'
))
{
throw
new
InterfaceException
([
'cus'
=>
0
]
);
throw
new
Exception
(
'没有grant_user_amount配置'
);
}
$httpParams
=
[
'capital_pool_id'
=>
self
::
CAPITAL_POOL_ID
...
...
@@ -112,13 +110,11 @@ class ColonelwalletController extends Job
}
$httpParams
[
'body'
]
=
$body
;
$res
=
HttpUtil
::
post
(
$url
,
$httpParams
,
100000
,
3
);
$this
->
loggerInfo
(
"url=
$url
,response:"
.
json_encode
(
$res
));
if
(
$res
[
'code'
]
==
0
&&
isset
(
$res
[
'response'
][
'result'
]))
{
$this
->
loggerInfo
(
'调用资金池服务成功,count='
.
count
(
$payInfoList
));
return
true
;
}
else
{
$this
->
loggerError
(
'调用资金池服务失败,httpParams='
.
json_encode
(
$httpParams
));
return
false
;
throw
new
Exception
(
'调用资金池服务失败,httpParams='
.
json_encode
(
$httpParams
));
}
}
...
...
@@ -180,17 +176,23 @@ class ColonelwalletController extends Job
return
$desc
;
}
/**
* Notes: 修改状态
* User: pengfei@yidian-inc.com
* Date: 2021/9/
3 6:09 下
午
* Date: 2021/9/
9 11:15 上
午
* @param array $payInfoIds
* @return bool
* @throws Exception
*/
private
function
handlePayInfoStatus
(
array
$payInfoIds
)
:
bool
{
return
ColonelDistributorPayInfo
::
updateRecord
([
'status'
=>
ColonelDistributorPayInfo
::
STATUS_USE
],
$upStatus
=
ColonelDistributorPayInfo
::
updateRecord
([
'status'
=>
ColonelDistributorPayInfo
::
STATUS_USE
],
[
'pay_info_id'
=>
$payInfoIds
]);
if
(
empty
(
$upStatus
))
{
throw
new
Exception
(
'更新pay_info状态失败.pay_info_ids='
.
implode
(
','
,
$payInfoIds
));
}
return
$upStatus
;
}
/**
...
...
application/services/marketing/PindanActivityInviteOrderService.php
View file @
417366c5
...
...
@@ -35,9 +35,10 @@ class PindanActivityInviteOrderService
return
true
;
}
$timeRange
=
PindanActivityColonelConfigService
::
getActivityTimeRange
();
$inviteOrderNumData
=
[
"colonel_user_id"
=>
$params
[
"colonel_user_id"
],
"date"
=>
date
(
"Y-m-d"
)
"date"
=>
$timeRange
[
'date'
]
];
$inviteOrderNum
=
ColonelDistributorInviteOrderNum
::
selectMaster
(
"*"
,
$inviteOrderNumData
,
[]);
...
...
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