From 9a0c00b7cde7c4b6274e952cf97bc1dc30a93c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Tue, 20 Oct 2026 16:45:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=AF=E5=88=86=E8=AE=B0=E5=BD=95):=20?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E6=8A=B5=E6=89=A3/=E6=8A=BD=E5=A5=96/?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=B1=BB=E5=9E=8B=E6=98=A0=E5=B0=84=E5=B9=B6?= =?UTF-8?q?=E6=8C=89=E8=AE=A2=E5=8D=95=E5=8F=B7=E5=9B=9E=E6=9F=A5=E6=8A=B5?= =?UTF-8?q?=E6=89=A3=E6=B5=81=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deduction/product_deduction 的 link_id 存订单号而非主键,单独按 order_no 回查;补齐积分抵扣、抽奖、注册送积分、积分兑换等类型名称 --- .../integral/StorePointRecordServices.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/backend/app/services/activity/integral/StorePointRecordServices.php b/backend/app/services/activity/integral/StorePointRecordServices.php index d0bbe6488..b8947592d 100644 --- a/backend/app/services/activity/integral/StorePointRecordServices.php +++ b/backend/app/services/activity/integral/StorePointRecordServices.php @@ -54,10 +54,21 @@ class StorePointRecordServices extends BaseService $typeNames = $status + [ 'gain' => '下单赠送积分', 'product_gain' => '购买商品赠送积分', + 'deduction' => '积分抵扣', + 'product_deduction' => '积分抵扣', + 'lottery_use' => '参与抽奖使用积分', + 'lottery_add' => '抽奖中奖赠送积分', + 'register_system_add' => '注册送积分', + 'storeIntegral_use' => '积分兑换商品', 'order_deduction' => '退款返还下单赠送积分', 'integral_refund' => '退款返还下单赠送积分', 'pay_product_integral_back' => '返还下单使用积分', ]; + // link_id 存中台订单号、需要按订单号回查的类型 + $orderNoLinkTypes = [ + 'deduction', + 'product_deduction', + ]; // link_id 存中台订单主键、可回查订单号的类型 $orderLinkTypes = [ 'gain', @@ -66,8 +77,6 @@ class StorePointRecordServices extends BaseService 'pay_give_integral', 'order_gain_refund', 'product_gain_refund', - 'deduction', - 'product_deduction', 'order_deduction', 'integral_refund', 'pay_product_integral_back', @@ -88,7 +97,9 @@ class StorePointRecordServices extends BaseService $integralOrderServices = app()->make(StoreIntegralOrderServices::class); foreach ($list as &$item) { $item['nickname'] = $nicknameArr[$item['uid']] ?? '未知用户'; - if (in_array($item['type'], $orderLinkTypes)) { + if (in_array($item['type'], $orderNoLinkTypes)) { + $item['relation'] = $orderServices->value(['order_no' => (string)$item['link_id']], 'order_no'); + } elseif (in_array($item['type'], $orderLinkTypes)) { $item['relation'] = $orderServices->value(['id' => $item['link_id']], 'order_no'); } elseif (in_array($item['type'], $integralOrderTypes)) { $item['relation'] = $integralOrderServices->value(['id' => $item['link_id']], 'order_id');