From b9d02d2fc638076740c256bd446d062a8fafc3d9 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 23 Dec 2025 11:10:21 +0800 Subject: [PATCH] bugfix --- pricing/pricing.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pricing/pricing.py b/pricing/pricing.py index 03ef86b..9a91344 100644 --- a/pricing/pricing.py +++ b/pricing/pricing.py @@ -50,10 +50,13 @@ where enabled_date >= ${biz_date}$ return recs[0] return None -async def sor_get_program_items(sor, ppid): +async def sor_get_program_items(sor, ppid, biz_date): sql = """select b.* from pricing_program_timing a, pricing_item b where b.pptid = a.id - and a.ppid = ${ppid}$""" + and a.ppid = ${ppid}$ + and a.enabled_date <= ${biz_date}$ + and a.expired_date > ${biz_date}$ +""" recs = await sor.sqlExe(sql, {'ppid': ppid}) return recs @@ -89,7 +92,7 @@ async def pricing_program_charging(sor, pricing_program_id, data): if not data.get('biz_date'): biz_date = await env.get_business_date(self.sor) data['biz_date'] = biz_date - pp_items = await pp.get_items(biz_date=data['biz_date']) + pp_items = await sor_get_program_items(pricing_program_id, data['biz_date']) charges = [] for item in pp_items: charge = item.copy()