fix: sor.U()参数错误 - id放data字典内而非单独传第3参数

This commit is contained in:
yumoqing 2026-07-02 18:53:04 +08:00
parent ff50eff07e
commit e79627c55f

View File

@ -3,13 +3,13 @@ result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Inv
try:
dbname = get_module_dbname('supplychain')
data = dict(params_kw)
record_id = data.pop('id', None)
record_id = data.get('id')
if not record_id:
raise ValueError('Missing id')
data['updated_at'] = timestampstr()
async with DBPools().sqlorContext(dbname) as sor:
await sor.U('supplier_resource_price', data, {'id': record_id})
await sor.U('supplier_resource_price', data)
result = {'widgettype': 'Message', 'options': {'title': 'Success', 'message': '定价更新成功', 'type': 'success'}}
except Exception as e: