From 5af266500f0489ddcfc9ec3c88288dce8607d927 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Mon, 9 Sep 2024 14:09:23 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9C=80=E8=BF=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Pay.php | 7 +++- app/api/logic/WithdrawLogic.php | 8 ++--- app/common/logic/PayNotifyLogic.php | 48 +++++++++++++-------------- app/common/server/WeChatPayServer.php | 5 ++- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/app/api/controller/Pay.php b/app/api/controller/Pay.php index 1294ce3e..278f6041 100755 --- a/app/api/controller/Pay.php +++ b/app/api/controller/Pay.php @@ -150,7 +150,12 @@ class Pay extends Api $config = WeChatServer::getPayConfig(Client_::mnp); return WeChatPayServer::notify($config); } - + public function notifyMnp1() + { + //$user_id = $this->user_id; + $config = WeChatServer::getPayConfig(Client_::mnp); + return WeChatPayServer::notify1($config); + } /** * @notes 公众号回调 diff --git a/app/api/logic/WithdrawLogic.php b/app/api/logic/WithdrawLogic.php index 516b3b33..ea2b1a25 100755 --- a/app/api/logic/WithdrawLogic.php +++ b/app/api/logic/WithdrawLogic.php @@ -105,7 +105,7 @@ class WithdrawLogic extends Logic 'bank' => $post['bank'] ?? '', 'subbank' => $post['subbank'] ?? '', 'poundage' => $poundage, - 'status' => 1, // 待提现 + 'status' => 3, // 待提现 'create_time' => time(), ]; $withdraw_id = WithdrawApply::insertGetId($data); @@ -171,7 +171,7 @@ class WithdrawLogic extends Logic 'bank' => $post['bank'] ?? '', 'subbank' => $post['subbank'] ?? '', 'poundage' => $poundage, - 'status' => 1, // 待提现 + 'status' => 3, // 待提现 'create_time' => time(), ]; $withdraw_id = BalanceWithdrawApply::insertGetId($data); @@ -319,7 +319,7 @@ class WithdrawLogic extends Logic 'bank' => $post['bank'] ?? '', 'subbank' => $post['subbank'] ?? '', 'poundage' => $poundage, - 'status' => 1, // 待提现 + 'status' => 3, // 待提现 'create_time' => time(), ]; $withdraw_id = WithdrawApply::insertGetId($das); @@ -419,7 +419,7 @@ class WithdrawLogic extends Logic 'bank' => $post['bank'] ?? '', 'subbank' => $post['subbank'] ?? '', 'poundage' => $poundage, - 'status' => 1, // 待提现 + 'status' => 3, // 待提现 'create_time' => time(), ]; $withdraw_id = BalanceWithdrawApply::insertGetId($d); diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 4daa84b2..58dcefe1 100755 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -230,33 +230,33 @@ class PayNotifyLogic if (isset($extra['transaction_id'])) { $d['transaction_id'] = $extra['transaction_id']; } - $result = Db::name("local_pay")->where("order_sn",$order_sn)->find(); + if($result['pay_status'] == 0){ + $local_store = Db::name('local_store')->where(['lstore_id' => $result['local_id']])->find(); + if ($local_store['empowerPhone']) { + event('Notice', [ + 'scene' => NoticeEnum::LOCAL_SHOP_COLLECTION_NOTICE, + 'mobile' => $local_store['empowerPhone'], + 'params' => [ + 'user_id' => $local_store['user_id'], + 'money' => round($result['order_amount']*0.6,2), + 'time' => date("Y-m-d H:i:s"), + 'order' => $order_sn, + ] + ]); + } - $local_store = Db::name('local_store')->where(['lstore_id' => $result['local_id']])->find(); - if ($local_store['empowerPhone']) { - event('Notice', [ - 'scene' => NoticeEnum::LOCAL_SHOP_COLLECTION_NOTICE, - 'mobile' => $local_store['empowerPhone'], - 'params' => [ - 'user_id' => $local_store['user_id'], - 'money' => round($result['order_amount']*0.6,2), - 'time' => date("Y-m-d H:i:s"), - 'order' => $order_sn, - ] - ]); + if($result != null){ + $d['pay_time'] = date("Y-m-d H:i:s"); + $d['pay_status'] = 1; + $order['lstore_id']= $result['local_id']; + $r = Db::name("local_pay")->where("id",$result['id'])->update($d); + } + $order['id']= 0; + $order['order_amount']= $result['order_amount']; + $order['order_sn']= $order_sn; + return self::recharge_billions($order, $result['user_id']); } - - if($result != null){ - $d['pay_time'] = date("Y-m-d H:i:s"); - $d['pay_status'] = 1; - $order['lstore_id']= $result['local_id']; - $r = Db::name("local_pay")->where("id",$result['id'])->update($d); - } - $order['id']= 0; - $order['order_amount']= $result['order_amount']; - $order['order_sn']= $order_sn; - return self::recharge_billions($order, $result['user_id']); } /** * @notes 子订单回调 diff --git a/app/common/server/WeChatPayServer.php b/app/common/server/WeChatPayServer.php index 5fcbafb0..79f5d4e8 100755 --- a/app/common/server/WeChatPayServer.php +++ b/app/common/server/WeChatPayServer.php @@ -391,7 +391,10 @@ class WeChatPayServer return $order_log_data; } - + public static function notify1($config) + { + PayNotifyLogic::handle('trade', $message['out_trade_no'], "$extra"); + } /** * @notes 支付回调 * @param $config