From 70920df001468a715cab199bfe280a963a6f7e10 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 29 Jun 2024 14:40:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E5=8A=A0=E5=85=91=E6=8D=A2=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/OrderController.php | 1 - app/common/logic/PayNotifyLogic.php | 23 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index bb8b584d6..6e6e9e17b 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -131,7 +131,6 @@ class OrderController extends BaseApiController } $order = OrderLogic::createOrder($cartId, $addressId, $user, $params); - if ($order != false) { if ($order['pay_price'] <= 0) { $pay_type = 3; diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 0ca0ac786..7276b3a56 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -66,7 +66,7 @@ class PayNotifyLogic extends BaseLogic public static function balancePay($orderSn, $extra = []) { $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - + self::afterPay($order);d(444); $user = User::where('id', $order['uid'])->find(); if ($user['now_money'] < $order['pay_price']) { throw new \Exception('余额不足'); @@ -826,7 +826,9 @@ class PayNotifyLogic extends BaseLogic $financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']); $financeLogic->out($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); $financeLogic->save(); - if ($order['uid'] > 0 && $order['total_price'] >= 500 && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS) { + $user_ship = User::where('id', $order['uid'])->value('user_ship');//会员不加兑换券 + if ($order['uid'] > 0 && $order['total_price'] >= 500 + && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS && $user_ship !=1) { $user_number = bcmul($order['pay_price'], '0.10', 2); $sing = [ 'uid' => $order['uid'], @@ -848,14 +850,7 @@ class PayNotifyLogic extends BaseLogic //用户下单该用户等级为1得时候才处理冻结金额 $user = User::where('id', $order['uid'])->find(); $user_ship = $user['user_ship']; - //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 (只有会员按照这个逻辑拆分,其余的还是按照正常的支付金额) - if ($user['user_ship'] == 1 && $order['pay_type'] != PayEnum::CASH_PAY) { - $vipFrozenAmount = self::dealFrozenPrice($order['id']); - //为1的时候要去减活动价 - $order['pay_price'] = bcsub($order['pay_price'], $vipFrozenAmount, 2); - self::dealVipAmount($order, $order['pay_type']); - } - if($order['total_price'] >= 500 && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS){ + if($order['total_price'] >= 500 && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS && $user_ship !=1){ $user_number = bcmul($order['pay_price'], '0.10', 2); $sing = [ 'uid' => $order['uid'], @@ -870,6 +865,14 @@ class PayNotifyLogic extends BaseLogic ]; $user_sing->save($sing); } + //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 (只有会员按照这个逻辑拆分,其余的还是按照正常的支付金额) + if ($user['user_ship'] == 1 && $order['pay_type'] != PayEnum::CASH_PAY) { + $vipFrozenAmount = self::dealFrozenPrice($order['id']); + //为1的时候要去减活动价 + $order['pay_price'] = bcsub($order['pay_price'], $vipFrozenAmount, 2); + self::dealVipAmount($order, $order['pay_type']); + } + } //查询用户对应的村长和队长 $address = UserAddress::where(['uid' => $order['uid'], 'is_default' => 1])->find(); From f7f60c47d9f212b61231ad164048828c4fe72de8 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 29 Jun 2024 14:45:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/controller/user/UserController.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/store/controller/user/UserController.php b/app/store/controller/user/UserController.php index dd6b82e4b..47e6b8653 100644 --- a/app/store/controller/user/UserController.php +++ b/app/store/controller/user/UserController.php @@ -40,16 +40,16 @@ class UserController extends BaseAdminController { $params = (new UserValidate())->post()->goCheck('storeAdd'); $code = $params['code']; - if($code && $params['mobile']){ - $remark = $params['mobile'].'_userArchives'; - $codeCache = Cache::get($remark); - if(empty($codeCache)){ - return $this->fail('验证码不存在'); - } - if ($codeCache != $code) { - return $this->fail('验证码错误'); - } - } +// if($code && $params['mobile']){ +// $remark = $params['mobile'].'_userArchives'; +// $codeCache = Cache::get($remark); +// if(empty($codeCache)){ +// return $this->fail('验证码不存在'); +// } +// if ($codeCache != $code) { +// return $this->fail('验证码错误'); +// } +// } UserLogic::StoreAdd($params); if (UserLogic::hasError() ) { return $this->fail(UserLogic::getError());