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 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=90=8E=E7=94=A8=E6=88=B7=E7=9A=84=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E6=94=AF=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']); From 17a6b57673fa161d1393bcdc6b9fb7b44ea93e5d Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 10:24:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=86=E6=B6=A6=E9=80=BB=E8=BE=91=E5=8F=AA=E6=9C=89=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E6=8C=89=E7=85=A7=E9=87=87=E8=B4=AD=E6=AC=BE=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=8B=86=E5=88=86,=E5=85=B6=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E5=88=86=E6=B6=A6=E8=BF=98=E6=98=AF=E6=8C=89=E7=85=A7=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E6=94=AF=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/PayNotifyLogic.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 0502a2d61..9b9a76d7b 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -309,20 +309,21 @@ class PayNotifyLogic extends BaseLogic { $financeLogic = new StoreFinanceFlowLogic(); $user_sing = new UserSign(); - + $vipFen = 0; if ($order['uid'] > 0) { // 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去 //用户下单该用户等级为1得时候才处理冻结金额 $user = User::where('id', $order['uid'])->find(); - //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 + //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 (只有会员按照这个逻辑拆分,其余的还是按照正常的支付金额) 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']; + $vipFen = $oldUser['purchase_funds']; } } - }elseif ($user['user_ship'] == 1){ + } + elseif ($user['user_ship'] == 1){ $vipFrozenAmount = self::dealFrozenPrice($order['id']); //为1的时候要去减活动价 // $final_price = bcsub($order['pay_price'],$order['deduction_price'],2); @@ -387,7 +388,11 @@ class PayNotifyLogic extends BaseLogic // if ($order['is_vip'] >= 1) { if ($order['spread_uid'] > 0) { $financeLogic->other_arr['vip_uid'] = $order['spread_uid']; - $fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2); + if($vipFen){ + $fees = bcdiv(bcmul($vipFen, '0.08', 2), 1, 2); + }else{ + $fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2); + } $count_frees = bcadd($count_frees, $fees, 2); if ($fees > 0) { User::where('id', $order['spread_uid'])->inc('now_money', $fees)->update(); From 5b01a6ab491d38c9fb84ba3bfaf1f4373b4a4410 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 10:56:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=B6=E9=93=B6?= =?UTF-8?q?=E5=8F=B0=E6=9F=A5=E8=AF=A2=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/store_order/StoreOrderLists.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/store/lists/store_order/StoreOrderLists.php b/app/store/lists/store_order/StoreOrderLists.php index 12f7c7208..3c86ba983 100644 --- a/app/store/lists/store_order/StoreOrderLists.php +++ b/app/store/lists/store_order/StoreOrderLists.php @@ -46,13 +46,13 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface */ public function lists(): array { - $store_id = $this->adminInfo['store_id']; + $store_id = $this->adminInfo['store_id']??5; $this->searchWhere[] = ['store_id' ,'=',$store_id]; $is_sashier=$this->request->get('is_sashier'); if($is_sashier==1){//收银台订单 - $this->searchWhere[] = ['pay_type','in',[17,9,13]]; + $this->searchWhere[] = ['pay_type','in',[17,9,13,18]]; }elseif($is_sashier==2){//小程序订单 - $this->searchWhere[] = ['pay_type','in',[7,3]]; + $this->searchWhere[] = ['pay_type','in',[7,3,18]]; } return StoreOrder::where($this->searchWhere) ->field(['id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status','paid']) From 4112b6ffe3e4560d9bbda59c4443d59802a8d0c7 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 11:23:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=94=B6=E9=93=B6=E5=B1=95=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/store_order/StoreOrderLogic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index 851180901..972e4ebeb 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -112,8 +112,10 @@ class StoreOrderLogic extends BaseLogic } if ($user && $user['user_ship'] == 1) { $pay_price = self::$pay_price; + $activity_string = ''; }else{ $pay_price =bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额 + $activity_string = '减免'; } $vipPrice = 0; @@ -132,7 +134,7 @@ class StoreOrderLogic extends BaseLogic 'cart_id' => implode(',', $cartId), 'store_id' => $params['store_id'] ?? 0, 'shipping_type' =>3,//配送方式 1=快递 ,2=门店自提 - 'activity' =>'减免', + 'activity' =>$activity_string, 'activity_price' =>self::$activity_price,//活动优惠价 'activities' => self::$activity_price>0?1:0, 'default_delivery'=>1,