From a83ffb86aa45ff6a0dea535d46ea57639f05b1ad Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 25 Sep 2023 13:26:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 1d2a48bc..4a4f0316 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -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]); From 4822e6bfc719fb07dff33b792029b2fd15c588f8 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 25 Sep 2023 13:41:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/paySuccessMargin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/listener/paySuccessMargin.php b/app/listener/paySuccessMargin.php index 2068a639..701e794c 100644 --- a/app/listener/paySuccessMargin.php +++ b/app/listener/paySuccessMargin.php @@ -21,8 +21,8 @@ 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']); + Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->inc('margin', (float)$marginInfo['total_price']); + Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->dec('recharge_margin', (float)$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) { Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([ From abead6ba26a8a426cdcb7fe8c904048968ea1edb Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 25 Sep 2023 13:58:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/paySuccessMargin.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/listener/paySuccessMargin.php b/app/listener/paySuccessMargin.php index 701e794c..bc4c208f 100644 --- a/app/listener/paySuccessMargin.php +++ b/app/listener/paySuccessMargin.php @@ -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', (float)$marginInfo['total_price']); - Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->dec('recharge_margin', (float)$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 ]);