From cc6fcf03e95f4c9a71d754afa9f31e00d2f8fdbc Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Mon, 4 Aug 2025 18:01:42 +0800 Subject: [PATCH] update --- b/product/publish_product_add.dspy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/b/product/publish_product_add.dspy b/b/product/publish_product_add.dspy index 1e42b2f..9502515 100644 --- a/b/product/publish_product_add.dspy +++ b/b/product/publish_product_add.dspy @@ -64,6 +64,7 @@ async def publish_product_add(ns={}): "net_card": ns.get("net_card"), "price": ns.get("price"), "unit": ns.get("unit"), + "discount": ns.get("discount"), "short_term": ns.get("short_term"), "priority": ns.get("priority") if ns.get("priority") else 1, "status": ns.get("status") if ns.get("status") else '0', @@ -75,6 +76,14 @@ async def publish_product_add(ns={}): "application_scenario": ns.get("application_scenario"), "audit_status": ns.get('audit_status', 'pending'), } + if ns.get('discount') == '0': + ns['discount'] = None + ns_dic['discount'] = None + + if ns.get('price') and ns.get('discount'): + ns_dic['discount_price'] = float(ns.get('price')) * float(ns['discount']) / 10 + else: + ns_dic['discount_price'] = ns['price'] user_role = await get_user_role({'userid': userid, 'sor': sor}) # 非客户角色不需要审批 if user_role != '客户':