From 44e550a0eb1738e0e2e8277a8b2581d1cb54cdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E5=BB=B6=E7=A5=A5?= <2256334253@qq.com> Date: Fri, 8 Mar 2024 11:16:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20fix=20=E8=B4=AD=E9=94=80=E5=8D=95?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AE=9A=E4=BB=B7=E4=BA=A7=E5=93=81=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E5=88=B0=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin-rental/src/server/services/record-service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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..b54778a48 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,9 @@ 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, ); From c7b45440a0cd7fe764816dcc6bee15a3f4e27f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E5=BB=B6=E7=A5=A5?= <2256334253@qq.com> Date: Fri, 8 Mar 2024 11:45:18 +0800 Subject: [PATCH 2/2] feat: fix#325 --- .../@hera/plugin-rental/src/server/services/record-service.ts | 1 + 1 file changed, 1 insertion(+) 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 b54778a48..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 @@ -271,6 +271,7 @@ export class RecordService { }); 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,