This commit is contained in:
yumoqing 2025-12-23 11:10:21 +08:00
parent e9cb3979a5
commit b9d02d2fc6

View File

@ -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()