fix(app): 修复支付回调和订单推送的相关问题

- 修改 PayNotifyLogic 中异常捕获,使用 Throwable 代替 Exception
- 优化 OrderXprinterPushSend 中的订单信息获取和处理
This commit is contained in:
mkm 2024-12-24 09:27:39 +08:00
parent 5727572e0d
commit 1f82805875
2 changed files with 4 additions and 2 deletions

View File

@ -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());

View File

@ -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));
}