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

46 lines
1.3 KiB
Plaintext

async def appCodesUpdate(ns={}):
"""
delete app code
`id` VARCHAR(32) 'id',
`name` VARCHAR(255) '编码名称',
`hierarchy_flg` VARCHAR(1) '多级标志',
`del_flg` VARCHAR(1) DEFAULT '0' comment '删除标志',
`create_at` TIMESTAMP comment '创建时间戳'
:param ns:
:return:
"""
ns_appcode = {
'id': ns.get('id'),
'name': ns.get('name'),
'hierarchy_flg': ns.get('hierarchy_flg')
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
if ns.get('kv'):
try:
await sor.U('appcodes_kv', ns)
return {
"status": True,
"msg": "appcodes_kv update success"
}
except Exception as e:
return {
"status": False,
"msg": "appcodes_kv update failed",
}
await sor.U('appcodes',ns_appcode)
return {
"status": True,
"msg": "appcodes update success",
}
except Exception as e:
return {
"status": False,
"msg": "appcodes update failed",
}
ret = await appCodesUpdate(params_kw)
return ret