perf(aftersale): 售后/退货拆包订单查询改为 attributes 白名单,减少全字段加载

This commit is contained in:
liufumingren 2026-09-20 16:14:06 +08:00
parent 1771b5c6c9
commit dc9f83a2d7
2 changed files with 5 additions and 0 deletions

View File

@ -476,6 +476,10 @@ class AfterSaleService extends Service {
try {
order = await ctx.model.OrderDelivery.findOne({
where: { id: orderDeliveryId },
attributes: [
'id', 'name', 'tel', 'mobile', 'email', 'zip_code', 'country_code',
'province', 'city', 'area', 'town', 'detail_address', 'store_id', 'items',
],
raw: true,
});
} catch (err) {

View File

@ -1958,6 +1958,7 @@ class ReturnUnpackService extends Service {
try {
order = await ctx.model.OrderDelivery.findOne({
where: { id: order_id },
attributes: [ 'id', 'source_order_codes', 'source_platform_code', 'logistics_name' ],
raw: true,
});
} catch (err) {