32 lines
828 B
Plaintext
32 lines
828 B
Plaintext
async def specific_data_add(ns={}):
|
|
"""
|
|
规格数据加
|
|
:param ns:
|
|
:return:
|
|
"""
|
|
spec_cnf = {
|
|
# 配置id和购物车产品id相同
|
|
'id': ns['id'],
|
|
'productid': ns.get('productid'),
|
|
'spec_data': ns.get('spec_data'),
|
|
'create_date': time.strftime('%Y-%m-%d')
|
|
}
|
|
if not ns.get('id'):
|
|
spec_cnf['id'] = uuid()
|
|
db = DBPools()
|
|
async with db.sqlorContext('kboss') as sor:
|
|
try:
|
|
await sor.C('specificdata', spec_cnf)
|
|
return {
|
|
"status": True,
|
|
"msg": "add specific data success"
|
|
}
|
|
except Exception as e:
|
|
raise e
|
|
return {
|
|
"status": False,
|
|
"msg": "add specific data failed"
|
|
}
|
|
|
|
ret = await specific_data_add(params_kw)
|
|
return ret |