2
0
Эх сурвалжийг харах

♻️ refactor(wechat-coupons): 优化优惠券查询关联关系

- 移除与stock的直接关联,仅保留stock.config关联关系
- 减少不必要的数据查询,提升接口性能
yourname 5 сар өмнө
parent
commit
78883b69f7

+ 1 - 1
src/server/api/wechat-coupons/index.ts

@@ -10,7 +10,7 @@ const wechatCouponRoutes = createCrudRoutes({
   getSchema: WechatCouponSchema,
   listSchema: WechatCouponSchema,
   searchFields: ['openid', 'stockId', 'couponId'],
-  relations: ['stock', 'stock.config'],
+  relations: ['stock.config'],
   middleware: [authMiddleware],
   userTracking: {
     createdByField: 'createdBy',