From 8bc15dd181d8292c1484778e1626b075383c5382 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 27 Jun 2024 20:09:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index e746a956b..bca087b71 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -300,10 +300,10 @@ class PayNotifyLogic extends BaseLogic } } - else{ + /* else{ //大于0的时候 //先处理金额大的再处理剩余的 - /**** 把所有的金额改为正的再加一条后再加***/ + //把所有的金额改为正的再加一条后再加 UserSign::where([ 'uid'=>$order['uid'], 'type'=>1, @@ -353,7 +353,7 @@ class PayNotifyLogic extends BaseLogic // User::where('id',$order['uid'])->inc('purchase_funds',$check)->update();//add } - } + }*/ } return true; From 90d05227f2984166e69fb24a25e116e64a5c4cd2 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 27 Jun 2024 20:35:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=85=E5=80=BC=E5=88=B0=E8=B4=A6?= =?UTF-8?q?=E7=A4=BC=E5=93=81=E5=88=B8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 6 ++-- app/common/logic/PayNotifyLogic.php | 44 +++++++++++++++++------------ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 7f256fe1a..a50baf6c9 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -458,7 +458,7 @@ class OrderLogic extends BaseLogic $money=$financeFlow->where(['order_id'=>$order['id'],'financial_pm'=>1,'financial_type'=>2])->value('number'); $financeFlowLogic->updateStatusStore($order['id'],$order['store_id'],$money,$deposit); - $check = Db::name('user_sign_log')->where('order_id',$order['order_id']) + /* $check = Db::name('user_sign_log')->where('order_id',$order['order_id']) ->where(['status'=>0]) ->find();//$check['number']扣的 if($check){ @@ -468,7 +468,7 @@ class OrderLogic extends BaseLogic $base = UserSign::where([ 'uid'=>$order['uid'], 'type'=>1, - 'status'=>0 + 'status'=>1 ])->find(); $user_sing = new UserSign(); if($base['number'] > 0 && $base['number'] >= $check['number']){ @@ -513,7 +513,7 @@ class OrderLogic extends BaseLogic } Db::name('user_sign_log')->where('order_id',$order['order_id'])->update(['status'=>1]); - } + }*/ Db::commit(); return true; diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index bca087b71..8c03f4776 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -206,15 +206,15 @@ class PayNotifyLogic extends BaseLogic OrderLogic::writeOff($params); } self::dealProductLog($order); - $count = UserSign::where([ - 'uid'=>$order['uid'], - 'type'=>1, - 'status'=>0 - ])->count(); - - if($count){ - self::addFlowLog($order); - } +// $count = UserSign::where([ +// 'uid'=>$order['uid'], +// 'type'=>1, +// 'status'=>0 +// ])->count(); +// +// if($count){ +// self::addFlowLog($order); +// } // if($order['shipping_type'] == 3){ // self::descStock($order['id']); // } @@ -234,15 +234,14 @@ class PayNotifyLogic extends BaseLogic 'type'=>1, 'status'=>0 ]); - $query1 = clone $query; - $ids = $query->column('id'); +// $query1 = clone $query; +// $ids = $query->column('id'); $check = $query->sum('number'); - $count = $query1->count(); +// $count = $query1->count(); if($check && $check >0){ $backPurchase = bcmul($order['pay_price'],0.1,2); - - if($count == 1){ +// if($count == 1){ //存在拆单子否 //少了就冻结减去这个对应的金额 $one = UserSign::where([ @@ -257,13 +256,15 @@ class PayNotifyLogic extends BaseLogic 'title' => '充值获得冻结兑换券', 'financial_pm' => 1, 'type' => 1, + 'status' => 1, ]; - if($one['back_num'] >= $backPurchase){ -// $wait = bcsub($one['back_num'],$backPurchase,2)??0; + if($one['number'] >= $backPurchase){ +// $wait = bcsub($one['number'],$backPurchase,2)??0; $data['number'] =$backPurchase; Db::name('user_sign_log')->insert($data); + //总的减去采购款百分之十剩余的 // if(empty($wait)){ // UserSign::where('id',$one['id'])->update( @@ -355,7 +356,7 @@ class PayNotifyLogic extends BaseLogic }*/ - } +// } return true; } @@ -613,10 +614,12 @@ class PayNotifyLogic extends BaseLogic 'financial_pm' => 1, 'store_id' => $order['store_id'], 'type' => 1, + 'status' => 1, 'number' => $total_vip, 'back_num' => $total_vip, ]; $user_sing->save($sing); + User::where('id',$order->uid)->inc('integral',$total_vip)->update(); return true; } @@ -666,7 +669,12 @@ class PayNotifyLogic extends BaseLogic if($order['other_uid']>0){ $uid=$order['other_uid']; } - self::dealRechargeFrozen($order); + $check = UserSign::where(['uid'=>$order->uid,'type'=>1])->count(); + if(empty($check)){ + self::dealRechargeFrozen($order); + + } + PushService::push('wechat_mmp_' . $uid, $uid, ['type'=>'INDUSTRYMEMBERS','msg'=>'订单支付成功','data'=>['id'=>$order['id'],'paid'=>1]]); PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type'=>'INDUSTRYMEMBERS','msg'=>'订单支付成功','data'=>['id'=>$order['id'],'paid'=>1]]); if (!empty($extra['payer']['openid'])) {