From 84eaf6c1ee01e844e9fd33f2072bce1cadf13802 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 24 Jun 2026 20:42:41 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=E6=AE=8B=E7=95=99?= =?UTF-8?q?=E7=9A=84api=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/get_product_discount_list.dspy | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 wwwroot/api/get_product_discount_list.dspy diff --git a/wwwroot/api/get_product_discount_list.dspy b/wwwroot/api/get_product_discount_list.dspy deleted file mode 100644 index 22f62da..0000000 --- a/wwwroot/api/get_product_discount_list.dspy +++ /dev/null @@ -1,44 +0,0 @@ -# 获取用户机构的所有产品及其折扣信息 -# 用于折扣明细设置页面 - -ns = params_kw.copy() -discountid = ns.get('discountid') - -if not discountid: - return {"total": 0, "rows": []} - -user_orgid = await get_userorgid() -if not user_orgid: - return {"total": 0, "rows": []} - -if not ns.get('page'): - ns['page'] = 1 -if not ns.get('sort'): - ns['sort'] = 'category_id, product_name' - -# 查询用户机构的所有产品,LEFT JOIN折扣明细 -sql = ''' -SELECT - p.id as productid, - p.product_name, - p.product_code, - p.category_id, - pc.name as category_name, - COALESCE(dd.id, '') as detail_id, - COALESCE(dd.discount, 0) as discount -FROM product p -LEFT JOIN product_category pc ON p.category_id = pc.id -LEFT JOIN discount_detail dd ON dd.productid = p.id AND dd.discountid = ${discountid}$ -WHERE p.org_id = ${org_id}$ AND p.status = '1' -ORDER BY p.category_id, p.product_name -''' - -ns['org_id'] = user_orgid -ns['discountid'] = discountid - -db = DBPools() -dbname = get_module_dbname('discount') -async with db.sqlorContext(dbname) as sor: - r = await sor.sqlPaging(sql, ns) - debug(f'get_product_discount_list: {len(r.get("rows", []))} products') - return r