script_engine/wwwroot/api/get_search_scene_id.dspy

9 lines
354 B
Plaintext

result = [{'value': '', 'text': '全部'}]
try:
async with get_sor_context(request._run_ns, 'scene') as sor:
rows = await sor.sqlExe('select id as value, name as text from scene order by name', {})
result = [{'value': '', 'text': '全部'}] + list(rows)
except Exception as e:
debug('get_search_scene_id error: %s' % e)
return result