async def update_user_invoice(ns={}): """ 保存用户发票信息 :param ns: :return: """ data = {} try: data['id'] = ns['id'] data['orgid'] = ns['orgid'] data['user_id'] = ns['user_id'] data['client_id'] = ns['client_id'] # `title_type` int(1) DEFAULT NULL COMMENT '抬头类型,1:个人,2:公司,3:组织', data['title_type'] = ns['title_type'] data['contract_number'] = ns['contract_number'] if data['title_type'] != 1: ns.pop('invoice_type') ns.pop('invoice_title') ns.pop('tax_no') ns['del_flg'] = 0 except Exception as e: return {"status": False, "msg": f"get key error, please check key:{str(e)}"} db = DBPools() async with db.sqlorContext('kboss') as sor: try: await sor.U('invoice_info', ns) return {"status": True, "msg": "ok"} except Exception as e: info(f"update_user_invoice sql error:{e}") return {"status": False, "msg": "sql error"} ret = await update_user_invoice(params_kw) return ret