Compare commits
No commits in common. "737878beb9cd782eb5e0494a90ab3e2c156dbae1" and "c969a62f63e7243576f828d399aaac9861738417" have entirely different histories.
737878beb9
...
c969a62f63
@ -645,8 +645,8 @@ async def baidu_users_get_post_pay(ns={}):
|
||||
userid = baidu_user['user_id']
|
||||
baidu_id = baidu_user['baidu_id']
|
||||
|
||||
if baidu_id != 'a6f0dbc20f074ea18b4d3ac3ec77d537':
|
||||
continue
|
||||
# if baidu_id != 'dcf0fa1519d24de893b186e52d733bd2':
|
||||
# continue
|
||||
try:
|
||||
user_orgid = (await sor.R('users', {'id': userid}))[0]['orgid']
|
||||
user_parentid = (await sor.R('organization', {'id': user_orgid}))[0]['parentid']
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
async def update_user_orders_interval(ns={}):
|
||||
"""
|
||||
更新用户订单列表
|
||||
"""
|
||||
domain_name = ns.get('domain_name')
|
||||
db = DBPools()
|
||||
async with db.sqlorContext('kboss') as sor:
|
||||
sql = """select bo.orderid, bs.user_id from baidu_orders as bo inner join baidu_users as bs on bo.accountid = bs.baidu_id inner join users as u on bs.user_id = u.id inner join organization as o on o.id = u.orgid where o.parentid = '%s' and bo.ordertype = 'RENEW' and bo.status = 'NEED_CONFIRM' and bo.del_flg = '0';""" % ns.get('orgid')
|
||||
order_list = await sor.sqlExe(sql, {})
|
||||
try:
|
||||
for order in order_list:
|
||||
orderid = order['orderid']
|
||||
user_id = order['user_id']
|
||||
url = 'https://%s/baiducloud/get_baidu_orderlist.dspy' % domain_name
|
||||
params = {
|
||||
'order_id': orderid,
|
||||
'userid': user_id
|
||||
}
|
||||
method = 'POST'
|
||||
async with aiohttp_client.request(
|
||||
method=method,
|
||||
url=url,
|
||||
json=params) as res:
|
||||
order_result = await res.text()
|
||||
with open('update_baidu_renew.log', 'a+') as f:
|
||||
# 行首添加时间
|
||||
f.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' ' + orderid + ':' + order_result + '\n')
|
||||
|
||||
url_update = 'https://%s/baiduc/update_baidu_order_list.dspy' % domain_name
|
||||
params_update = {
|
||||
'orgid': ns.get('orgid')
|
||||
}
|
||||
method = 'POST'
|
||||
async with aiohttp_client.request(
|
||||
method=method,
|
||||
url=url_update,
|
||||
json=params_update) as res:
|
||||
data_text = await res.text()
|
||||
with open('update_baidu_renew.log', 'a+') as f:
|
||||
# 行首添加时间
|
||||
f.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' ' + data_text + '\n')
|
||||
return {
|
||||
'status': True,
|
||||
'msg': '更新成功'
|
||||
}
|
||||
except Exception as e:
|
||||
import traceback
|
||||
with open('update_baidu_renew.log', 'a+') as f:
|
||||
f.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' ' + str(e) + traceback.format_exc() + '\n')
|
||||
traceback.print_exc()
|
||||
|
||||
ret = await update_user_orders_interval(params_kw)
|
||||
return ret
|
||||
@ -46,7 +46,7 @@ async def get_ipc_logo(ns={}):
|
||||
if '?domain_name=' in url_link:
|
||||
domain_url = url_link.split('?domain_name=')[1]
|
||||
# 如果是业主机构
|
||||
if ('ncmatch' in domain_url or '9527' in domain_url or '8889' in domain_url or '8891' in domain_url or domain_url in ['xterm.kaiyuancloud.cn','www.kaiyuancloud.cn', 'dev.kaiyuancloud.cn', 'dev.opencomputing.cn', 'test.kaiyuancloud.cn', 'localhost', 'www.opencomputing.cn', 'opencomputing.cn']) and '/domain/' not in url_link:
|
||||
if ('ncmatch' in domain_url or '9527' in domain_url or '8889' in domain_url or '8891' in domain_url or domain_url in ['xterm.kaiyuancloud.cn','www.kaiyuancloud.cn', 'dev.kaiyuancloud.cn', 'dev.opencomputing.cn', 'test.kaiyuancloud.cn', 'localhost']) and '/domain/' not in url_link:
|
||||
yezhu_info = (await sor.R('organization', {'org_type': '0'}))[0]
|
||||
domain_res = (await sor.R('params', {'pname': '业主机构域名'}))[0]['pvalue']
|
||||
# yezhu = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user