commit
f6479968b5
@ -196,7 +196,7 @@ class MerchantIntention extends BaseController
|
||||
$postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';
|
||||
$res = $this->sendMerIntentionApply($sendData, $postUrl);
|
||||
if (!$res['ok']) {
|
||||
Db::name('merchant_integntion')->where('mer_intention_id', $intentionId)->delete();
|
||||
Db::name('merchant_intention')->where('mer_intention_id', $intentionId)->delete();
|
||||
throw new ValidateException('商户交易申请失败,' . $res['msg']);
|
||||
}
|
||||
Db::name('merchant')->where('uid', $this->userInfo->uid)->where('status', 1)->update(['business_status'=>1]);
|
||||
|
@ -21,10 +21,16 @@ class paySuccessMargin
|
||||
'paid' => 1,
|
||||
'pay_time' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->inc('margin',$marginInfo['total_price']);
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->dec('recharge_margin',$marginInfo['total_price']);
|
||||
$merchantInfo = Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->find();
|
||||
if ($merchantInfo['recharge_margin'] <= 0) {
|
||||
$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
|
||||
]);
|
||||
$rechargeAmount = (float)$marginInfo['recharge_margin'] - (float)$merchantInfo['total_price'];
|
||||
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
|
||||
'recharge_margin' => $rechargeAmount
|
||||
]);
|
||||
if ($rechargeAmount <= 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