def delete_tenant(): """ 删除关联用户 :return: """ args = request.args tenant_id = args.get("tenant_id") print Tenant.delete_tenants(tenant_id=tenant_id) ret = {"retCode": "0000", "retMsg": ""} return jsonify(ret)
def get_tenant(): """ 获取房子住户 :return: """ house_info_id = request.args.get("house_code") tenants = Tenant.get_tenants(house_info_id=house_info_id) ret = { "retCode": "0000", "retMsg": "", "tenantList": [ {"user_id": tenant.id, "name": tenant.name, "phone": tenant.phone, "type": tenant.tenant_type} for tenant in tenants ], } return jsonify(ret)