fix(star_discount): SQL 去掉不存在的 d.discount 列

discount 表无 discount 字段(值在 discount_detail 表)。原 select d.id, d.discount
导致 reseller 级通用折扣(customerid=NULL)查询永远报 Unknown column 错误,
被上层 try/except 兜住后 fallback 到 1.0,通用折扣形同虚设。
This commit is contained in:
ymq 2026-08-26 15:52:03 +08:00
parent f9408e12e2
commit a3d7077acc
5 changed files with 217 additions and 220 deletions

View File

@ -135,7 +135,7 @@ async def _discount_detail_exists(sor):
async def sor_get_star_discount(sor, resellerid, biz_date):
"""Get default discount for a reseller (no specific customer)."""
sql = """select d.id, d.discount from discount d
sql = """select d.id from discount d
where d.resellerid = ${resellerid}$
and d.customerid is NULL
and d.enabled_date <= ${biz_date}$

View File

@ -1,6 +1,5 @@
{
"tblname": "discount",
"alias": "discount_list",
"title": "折扣管理",
"params": {
"sortby": [

View File

@ -1,6 +1,5 @@
{
"tblname": "discount_marketing",
"alias": "discount_marketing_list",
"title": "营销方案",
"params": {
"browserfields": {

View File

@ -1,6 +1,5 @@
{
"tblname": "discount_promo_code",
"alias": "discount_promo_code_list",
"title": "促销码",
"params": {
"browserfields": {

View File

@ -6,19 +6,19 @@
"cwidth":10,
"items":[
{
"name":"discount_list",
"name":"discount",
"label": "折扣管理",
"url": "{{entire_url('discount_list/index.ui')}}"
"url": "{{entire_url('discount/index.ui')}}"
},
{
"name":"discount_marketing_list",
"name":"discount_marketing",
"label": "营销方案",
"url": "{{entire_url('discount_marketing_list/index.ui')}}"
"url": "{{entire_url('discount_marketing/index.ui')}}"
},
{
"name":"discount_promo_code_list",
"name":"discount_promo_code",
"label": "促销码",
"url": "{{entire_url('discount_promo_code_list/index.ui')}}"
"url": "{{entire_url('discount_promo_code/index.ui')}}"
},
{
"name":"discount_customer_bind_list",