49 lines
2.5 KiB
Plaintext
49 lines
2.5 KiB
Plaintext
async def contact(ns={}):
|
|
# userid = await get_user()
|
|
# domain = ns.get('domain')
|
|
# db = DBPools()
|
|
# async with db.sqlorContext('kboss') as sor:
|
|
# user = await sor.R('users', {'id': userid})
|
|
# if user:
|
|
# orgid = user[0]['orgid']
|
|
# sales = await sor.R('customer', {'customerid': orgid})
|
|
# if sales:
|
|
# for sale in sales:
|
|
# saleid = sale['salemanid']
|
|
# sales_info = await sor.R('users', {'id': saleid})
|
|
# if sales_info:
|
|
# contactor_phone = sales_info[0]['mobile']
|
|
# contactor_image = sales_info[0]['picture']
|
|
# if domain == 'www':
|
|
# picture_urls = f"https://www.opencomputing.cn/idfile?path={contactor_image}"
|
|
# else:
|
|
# picture_urls = f"https://xterm.opencomputing.cn/idfile?path={contactor_image}"
|
|
#
|
|
# return {'status': True, 'msg': '展示成功', 'contactor_phone': contactor_phone,
|
|
# 'picture_url': picture_urls}
|
|
# else:
|
|
# orgid = 'mIWUHBeeDM8mwAFPIQ8pS'
|
|
# ss = await sor.R('organization', {'id': orgid, 'del_flg': 0})
|
|
#
|
|
# if domain == 'www':
|
|
# picture_url = f"https://www.opencomputing.cn/idfile?path={ss[0]['picture']}"
|
|
# else:
|
|
# picture_url = f"https://xterm.opencomputing.cn/idfile?path={ss[0]['picture']}"
|
|
#
|
|
# return {'status': True, 'msg': '展示成功', 'contactor_phone': ss[0]["contactor_phone"],
|
|
# 'picture_url': picture_url}
|
|
# else:
|
|
# orgid = 'mIWUHBeeDM8mwAFPIQ8pS'
|
|
# ss = await sor.R('organization', {'id': orgid, 'del_flg': 0})
|
|
#
|
|
# if domain == 'www':
|
|
# picture_url = f"https://www.opencomputing.cn/idfile?path={ss[0]['picture']}"
|
|
# else:
|
|
# picture_url = f"https://xterm.opencomputing.cn/idfile?path={ss[0]['picture']}"
|
|
|
|
picture_url = 'https://www.opencomputing.cn/idfile?path=firstpagehot/wechat_person.png'
|
|
return {'status': True, 'msg': '展示成功', 'contactor_phone': ' 400-6150805, 010-65917875',
|
|
'picture_url': picture_url}
|
|
|
|
ret = await contact(params_kw)
|
|
return ret |