Compare commits
No commits in common. "9e9dfae6d0dd956eb5ad226ee68ad2f79f592967" and "72a1659037d76de823457dad0c73210b0b3a9a64" have entirely different histories.
9e9dfae6d0
...
72a1659037
@ -69,18 +69,10 @@ async def affirmbz_order(ns={}):
|
|||||||
# 处理退订逻辑
|
# 处理退订逻辑
|
||||||
if order_type == 'REFUND':
|
if order_type == 'REFUND':
|
||||||
# 找到资源并更新时间
|
# 找到资源并更新时间
|
||||||
resource_find_sql = """select id, resourceid, expire_resourceid from customer_goods where FIND_IN_SET('%s', resourceid) and del_flg = '0';""" % j['resourceids']
|
resource_find_sql = """select id from customer_goods where resourceid = '%s';""" % j['resourceids']
|
||||||
resource_find_li = await sor.sqlExe(resource_find_sql, {})
|
resource_find_li = await sor.sqlExe(resource_find_sql, {})
|
||||||
resource_find_id = resource_find_li[0]['id']
|
resource_find_id = resource_find_li[0]['id']
|
||||||
expire_resourceid = resource_find_li[0]['expire_resourceid']
|
await sor.U('customer_goods', {'id': resource_find_id, 'del_flg': '1'})
|
||||||
expire_resourceid += expire_resourceid + ',' + j['resourceids'] if expire_resourceid else j['resourceids']
|
|
||||||
items_refund = resource_find_li[0]['resourceid'].split(',') if resource_find_li[0]['resourceid'] else []
|
|
||||||
filtered_items = [item for item in items_refund if item != j['resourceids']]
|
|
||||||
result = ','.join(filtered_items)
|
|
||||||
if not result:
|
|
||||||
await sor.U('customer_goods', {'id': resource_find_id, 'del_flg': '1'})
|
|
||||||
else:
|
|
||||||
await sor.U('customer_goods', {'id': resource_find_id, 'resourceid': result, 'expire_resourceid': expire_resourceid})
|
|
||||||
|
|
||||||
# 处理续费逻辑
|
# 处理续费逻辑
|
||||||
elif order_type == 'RENEW':
|
elif order_type == 'RENEW':
|
||||||
@ -418,22 +410,6 @@ async def get_baidu_orderlist(ns={}):
|
|||||||
nss['unit'] = i.get('timeUnit')
|
nss['unit'] = i.get('timeUnit')
|
||||||
nss['resourceids'] = ','.join(i['shortIds']) if i.get('shortIds') else ''
|
nss['resourceids'] = ','.join(i['shortIds']) if i.get('shortIds') else ''
|
||||||
nss['orderkey'] = i.get('key')
|
nss['orderkey'] = i.get('key')
|
||||||
|
|
||||||
try:
|
|
||||||
# 保存配置configurations 存入specdata表中
|
|
||||||
if i.get('configurations'):
|
|
||||||
specdata = json.dumps(i['configurations'], ensure_ascii=False)
|
|
||||||
ns_specificdata = {
|
|
||||||
'id': uuid(),
|
|
||||||
'productid': product[0]['id'],
|
|
||||||
'spec_data': specdata,
|
|
||||||
}
|
|
||||||
nss['spec_id'] = ns_specificdata['id']
|
|
||||||
await sor.C('specificdata', ns_specificdata)
|
|
||||||
except Exception as e:
|
|
||||||
print('保存配置configurations失败', str(e))
|
|
||||||
with open('baidu_error.log', 'a') as f:
|
|
||||||
f.write('保存配置configurations失败' + str(e) + '\n')
|
|
||||||
|
|
||||||
# 如果是续费订单 由于没有返回日期, 重新计算日期
|
# 如果是续费订单 由于没有返回日期, 重新计算日期
|
||||||
if order_type == 'RENEW':
|
if order_type == 'RENEW':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user