fix: align get_search_providerid.dspy with {value, text} format using SQL aliases
This commit is contained in:
parent
9377cfabb8
commit
308e91c61c
@ -1,14 +1,12 @@
|
|||||||
result = [{'providerid': '', 'providerid_text': '全部'}]
|
result = [{'value': '', 'text': '全部'}]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with get_sor_context(request._run_ns, 'rbac') as sor:
|
async with get_sor_context(request._run_ns, 'rbac') as sor:
|
||||||
orgs = await sor.sqlExe(
|
orgs = await sor.sqlExe(
|
||||||
"select id, orgname from organization order by orgname",
|
"select id as value, orgname as text from organization order by orgname",
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
if orgs:
|
return orgs
|
||||||
for r in orgs:
|
|
||||||
result.append({'providerid': str(r.id), 'providerid_text': r.orgname or ''})
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
debug(f'get_search_providerid error: {e}')
|
debug(f'get_search_providerid error: {e}')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user