- 新增 api/get_customer_list.dspy,返回带*选项的客户列表 - json/discount_list.json: customerid 使用自定义 dataurl - load_path.py: 注册新API到logined和operator
12 lines
346 B
Plaintext
12 lines
346 B
Plaintext
# 获取客户列表(带 * 全部客户选项)
|
|
db = DBPools()
|
|
sql = "select id as customerid, orgname as customerid_text from organization where 1=1 order by orgname"
|
|
|
|
rs = [{'customerid': '*', 'customerid_text': '全部客户'}]
|
|
|
|
async with db.sqlorContext('sage') as sor:
|
|
data = await sor.sqlExe(sql, {})
|
|
rs.extend(data)
|
|
|
|
return rs
|