salescrm/b/apv/apv_template.dspy
2025-10-27 15:50:44 +08:00

26 lines
908 B
Plaintext

async def apv_template(ns={}):
try:
data = {
"id": ns.get("id", None),
"business_id": ns["business_id"],
"title_template": ns["title_template"],
"detail_template": ns["detail_template"],
}
except Exception as e:
return {"status": False, "msg": f"参数解析错误,请检查参数:{e}"}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
if data['id']:
data['update_at'] = '{}'.format(datetime.datetime.now())
num = await sor.U("apv_content_template", data)
if num == 0:
return {"status": False, "msg": "更新失败,数据未更改"}
else:
data['id'] = uuid()
await sor.C("apv_content_template", data)
return {"status": True, "msg": "success","data":data['id']}
ret = await apv_template(params_kw)
return ret