更新保证金
This commit is contained in:
parent
55d8a5b1d0
commit
41ae811e8a
@ -22,15 +22,15 @@ class paySuccessMargin
|
||||
'pay_time' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
$merchantInfo = Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->find();
|
||||
$marginAmount = (float)$merchantInfo['margin'] + (float)$marginInfo['total_price'];
|
||||
$paidMarginAmount = (float)$merchantInfo['paid_margin'] + (float)$marginInfo['total_price'];
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
|
||||
'paid_margin' => $paidMarginAmount
|
||||
]);
|
||||
$marginAmount = (float)$merchantInfo['margin'] - (float)$marginInfo['total_price'];
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
|
||||
'margin' => $marginAmount
|
||||
]);
|
||||
$paidAmount = (float)$merchantInfo['paid_margin'] - (float)$marginInfo['total_price'];
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
|
||||
'paid_margin' => $paidAmount
|
||||
]);
|
||||
if ($paidAmount <= 0) {
|
||||
if ($marginAmount <= 0) {
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
|
||||
'is_margin' => 10
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user