diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts index c5b3eb91d..77ab3c8fd 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts @@ -269,8 +269,10 @@ export class RecordService { spec: size, }, }); - const product_category = product.category_id + 99999; - priceRuleArr.push({ id: product_category, unit_price: porduct_item.price }); + const product_id = product.id; + const exist = priceRuleArr.findIndex((rule) => rule.id === product_id) > -1; + // 规则去重 + !exist && priceRuleArr.push({ id: product_id, unit_price: porduct_item.price }); const fee = values.data.complements.filter( (item) => item.associate.name === porduct_item.name && item.associate.size === porduct_item.size, );