From 8a8c7116fa67ec47035f5fe5a086aeede7179a71 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 3 Mar 2025 11:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98=E9=98=9F?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queue/redis/CodePaySend.php | 2 +- process/Task.php | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/app/queue/redis/CodePaySend.php b/app/queue/redis/CodePaySend.php index da3da4e9..4224a327 100644 --- a/app/queue/redis/CodePaySend.php +++ b/app/queue/redis/CodePaySend.php @@ -44,7 +44,7 @@ class CodePaySend implements Consumer public function onConsumeFailure(\Throwable $exception, $package) { // 直接更改消息队列数据结构,将最大重试次数max_attempts字段设置为0,即不再重试。 - if($package['attempts'] ==$exception['max_attempts']){ + if($package['attempts'] == 12){ $pay = new PayService(); $data = [ 'order_id' => $package['data']['order_id'], diff --git a/process/Task.php b/process/Task.php index fb94be22..8682101d 100644 --- a/process/Task.php +++ b/process/Task.php @@ -43,29 +43,6 @@ class Task //删除未充值的订单 UserRecharge::where('paid', 0)->where('status', 1)->where('create_time', '<', $oneHourAgo)->update(['delete_time' => time()]); }); - //每10秒执行一次 - new Crontab('*/10 * * * * *', function () { - $select=Db::name('wechat_micropay')->limit(100)->select(); - $pay = new PayService(); - foreach ($select as $k=>$v) { - $time = time(); - if ($time - $v['create_time'] > 60){ - Db::name('wechat_micropay')->where('id',$v['id'])->delete(); - continue; - } - $order = [ - 'out_trade_no' => $v['order_id'], - ]; - $res = $pay->wechat->query($order); - if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') { - if(isset($data['pay_type']) && $data['pay_type']=='recharge'){ - PayNotifyLogic::handle('recharge', $res['out_trade_no'], $res); - }else{ - PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); - } - } - } - }); $this->updateProductPrice(); $this->confirmProductPrice();