This commit is contained in:
yumoqing 2026-02-25 13:49:16 +08:00
parent c890fdf249
commit 98581b2a37
2 changed files with 4 additions and 3 deletions

View File

@ -65,7 +65,7 @@ async def set_promote_discount(request, params_kw):
need_new_discount = await disable_old_discount(sor, recs[0].resellerid,
customerid, biz_date, recs[0].discount)
if not need_new_discount:
return
return await sor_get_customer_discount(sor, recs[0].resellerid, customerid)
ret = {
'id': getID(),
'resellerid': recs[0].resellerid,
@ -75,7 +75,7 @@ async def set_promote_discount(request, params_kw):
'expired_date': expired_date
}
await sor.C('discount', ret.copy())
return DictObject(**ret)
return recs[0].discount
return None
async def disable_old_discount(sor, resellerid, customerid, biz_date, new_discount):
@ -87,7 +87,7 @@ where resellerid = ${resellerid}$
recs = await sor.sqlExe(sql, {'resellerid': resellerid, 'customerid': customerid, 'biz_date': biz_date})
if not recs:
return True
if new_discount > news[0].discount:
if new_discount > recs[0].discount:
return False
await sor.U('discount', {'id': recs[0].id, 'expired_date': biz_date})
return True

View File

@ -3,3 +3,4 @@ if orgid is None:
return UiError(title='Error', message='You need login')
ret = await set_promote_discount(request, params_kw)
return UiMessage(title="Succeeded", message=f'获得{ret}折扣')