kboss/b/product/home_page_content_delete.dspy
2025-11-27 18:00:11 +08:00

33 lines
903 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

async def home_page_content_delete(ns={}):
"""
软删除内容项id值必传并且把del_flg值修改为1
:param ns: 包含id的字典
:return: 删除结果
"""
if not ns.get('id'):
return {
'status': False,
'msg': 'id is required'
}
ns_dic = {
'id': ns.get('id'),
'del_flg': '1'
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
await sor.U('home_page_content_items', ns_dic)
return {
'status': True,
'msg': 'delete home page content success'
}
except Exception as e:
await sor.rollback()
return {
'status': False,
'msg': 'delete home page content failed, %s' % str(e)
}
ret = await home_page_content_delete(params_kw)
return ret