main #143
@ -37,7 +37,7 @@ async def sync_model_to_llm(ns={}):
|
||||
exist_org_li = await sor.R('organization', {'orgcode': provider_orgcode, 'del_flg': '0'})
|
||||
if exist_org_li:
|
||||
provider_orgid = exist_org_li[0].get('id')
|
||||
await sor.U('organization', {'id': provider_orgid}, {
|
||||
await sor.U('organization', {
|
||||
'id': provider_orgid,
|
||||
'orgname': provider_name,
|
||||
'orgcode': provider_orgcode,
|
||||
@ -78,7 +78,7 @@ async def sync_model_to_llm(ns={}):
|
||||
if provider_li:
|
||||
provider_id = provider_li[0].get('id')
|
||||
provider_data['id'] = provider_id
|
||||
await sor.U('provider', {'id': provider_id}, provider_data)
|
||||
await sor.U('provider', provider_data)
|
||||
else:
|
||||
provider_id = uuid()
|
||||
provider_data['id'] = provider_id
|
||||
@ -87,7 +87,7 @@ async def sync_model_to_llm(ns={}):
|
||||
protocol_li = await sor.R('saleprotocol', {'offer_orgid': provider_orgid, 'bid_orgid': sync_orgid, 'del_flg': '0'})
|
||||
if protocol_li:
|
||||
protocolid = protocol_li[0].get('id')
|
||||
await sor.U('saleprotocol', {'id': protocolid}, {
|
||||
await sor.U('saleprotocol', {
|
||||
'id': protocolid,
|
||||
'offer_orgid': provider_orgid,
|
||||
'bid_orgid': sync_orgid,
|
||||
@ -121,7 +121,7 @@ async def sync_model_to_llm(ns={}):
|
||||
'providerid': provider_orgid,
|
||||
'providerpid': item.get('id'),
|
||||
'name': item.get('name'),
|
||||
'description': item.get('description') or '',
|
||||
# 'description': item.get('description') or '',
|
||||
'ptype': '21',
|
||||
'state': '1',
|
||||
'salemode': '0',
|
||||
@ -129,7 +129,7 @@ async def sync_model_to_llm(ns={}):
|
||||
'reseller_orgid': sync_orgid,
|
||||
'classify': 'A',
|
||||
'label': item.get('catelogname') or category_list.get('catelogname'),
|
||||
'productgroup': item.get('catelog_id') or item.get('catelogid') or category_list.get('catelogid'),
|
||||
# 'productgroup': item.get('catelog_id') or item.get('catelogid') or category_list.get('catelogid'),
|
||||
'product_area': '北京',
|
||||
'effect_date': '2026-07-01',
|
||||
'expire_date': '9999-12-31'
|
||||
@ -138,7 +138,7 @@ async def sync_model_to_llm(ns={}):
|
||||
if product_li:
|
||||
product_id = product_li[0].get('id')
|
||||
product_data['id'] = product_id
|
||||
await sor.U('product', {'id': product_id}, product_data)
|
||||
await sor.U('product', product_data)
|
||||
product_action = 'update'
|
||||
else:
|
||||
product_id = uuid()
|
||||
@ -161,7 +161,7 @@ async def sync_model_to_llm(ns={}):
|
||||
})
|
||||
if product_salemode_li:
|
||||
salemode_data['id'] = product_salemode_li[0].get('id')
|
||||
await sor.U('product_salemode', {'id': salemode_data['id']}, salemode_data)
|
||||
await sor.U('product_salemode', salemode_data)
|
||||
else:
|
||||
salemode_data['id'] = uuid()
|
||||
await sor.C('product_salemode', salemode_data)
|
||||
@ -173,7 +173,7 @@ async def sync_model_to_llm(ns={}):
|
||||
exist_llm = await sor.R('llm', {'model': item.get('model')})
|
||||
if exist_llm:
|
||||
llm_data['id'] = exist_llm[0].get('id')
|
||||
await sor.U('llm', {'id': llm_data['id']}, llm_data)
|
||||
await sor.U('llm', llm_data)
|
||||
return 'update'
|
||||
await sor.C('llm', llm_data)
|
||||
return 'insert'
|
||||
@ -285,7 +285,7 @@ async def sync_model_to_llm(ns={}):
|
||||
for exist_llm in exist_llm_li:
|
||||
exist_model = exist_llm.get('model')
|
||||
if exist_model and exist_model not in current_model_set and exist_llm.get('status') != 'unpublished':
|
||||
await sor.U('llm', {'id': exist_llm.get('id')}, {
|
||||
await sor.U('llm', {
|
||||
'id': exist_llm.get('id'),
|
||||
'status': 'unpublished'
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user