From b1e1e39164dbb2e54b7205d0baf76faaeab3527e Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 10:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E4=BA=AB=E5=90=8E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9A=84=E4=BD=BF=E7=94=A8=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CapitalFlowLogic.php | 2 +- app/common/logic/PayNotifyLogic.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/common/logic/CapitalFlowLogic.php b/app/common/logic/CapitalFlowLogic.php index d2c7ab918..1b6aea9ba 100644 --- a/app/common/logic/CapitalFlowLogic.php +++ b/app/common/logic/CapitalFlowLogic.php @@ -57,7 +57,7 @@ class CapitalFlowLogic extends BaseLogic * @param $mark * @return mixed */ - public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0,) + public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0) { $model = new CapitalFlow(); $model->uid = $this->user['id']; diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index ec383da9b..0502a2d61 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -314,12 +314,13 @@ class PayNotifyLogic extends BaseLogic // 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去 //用户下单该用户等级为1得时候才处理冻结金额 $user = User::where('id', $order['uid'])->find(); - //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 - if ($order['spread_uid'] > 0 && $user['user_ship'] == 1) { - $oldUser = User::where('id',$order['spread_uid'])->value('purchase_funds'); - if ($oldUser < $order['pay_price']) { - $order['pay_price'] = $oldUser; + if ($order['spread_uid'] > 0) { + $oldUser = User::where('id',$order['spread_uid'])->field('purchase_funds,user_ship')->find(); + if ($oldUser && $oldUser['user_ship'] == 1){ + if ($oldUser['purchase_funds'] < $order['pay_price']) { + $order['pay_price'] = $oldUser['purchase_funds']; + } } }elseif ($user['user_ship'] == 1){ $vipFrozenAmount = self::dealFrozenPrice($order['id']);