From 1f82805875dec4eb668804a29109b57488410edf Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 24 Dec 2024 09:27:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(app):=20=E4=BF=AE=E5=A4=8D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=9B=9E=E8=B0=83=E5=92=8C=E8=AE=A2=E5=8D=95=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E7=9A=84=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 PayNotifyLogic 中异常捕获,使用 Throwable 代替 Exception - 优化 OrderXprinterPushSend 中的订单信息获取和处理 --- app/common/logic/PayNotifyLogic.php | 3 ++- app/queue/redis/OrderXprinterPushSend.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 9539d11ca..c91074eee 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -11,6 +11,7 @@ use app\common\enum\user\UserShipEnum; use app\common\enum\YesNoEnum; use app\common\logic\user_product_storage\UserProductStorageLogic; use app\common\model\Config; +use app\common\model\dict\DictData; use app\common\model\dict\DictType; use app\common\model\finance\CapitalFlow; use app\common\model\finance\PayNotifyLog; @@ -53,7 +54,7 @@ class PayNotifyLogic extends BaseLogic self::$action($orderSn, $extra, $type); Db::commit(); return true; - } catch (\Exception $e) { + } catch (\Throwable $e) { Db::rollback(); d($e); Log::error('支付回调处理失败' . $e->getMessage() . ',lien:' . $e->getLine() . ',file:' . $e->getFile()); diff --git a/app/queue/redis/OrderXprinterPushSend.php b/app/queue/redis/OrderXprinterPushSend.php index 7518e2d92..205f09074 100644 --- a/app/queue/redis/OrderXprinterPushSend.php +++ b/app/queue/redis/OrderXprinterPushSend.php @@ -29,6 +29,7 @@ class OrderXprinterPushSend implements Consumer $order = $data['order']; $total_price = $order['total_price']; $pay_price = $order['pay_price']; + $store_id = $order['store_id']; $deduction_price = $order['deduction_price']; $pay_time = date('Y-m-d H:i:s', $order['pay_time']); $pay_type = PayEnum::getPaySceneDesc($order['pay_type']); @@ -62,7 +63,7 @@ class OrderXprinterPushSend implements Consumer 'pay_type_name' => $pay_type, 'product_arr' => $product_arr ]; - $value=DictData::where('name','xprinter_'.$order['store_id'])->value('value'); + $value=DictData::where('name','xprinter_'.$store_id)->value('value'); if($value){ $res = ($api->printFontAlign($value, $order)); }