From 70a41c7ef797e95574049f87ee19e661cd3cf0d6 Mon Sep 17 00:00:00 2001 From: liguangyu06 <1666071293@qq.com> Date: Fri, 2 Feb 2024 09:20:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._\344\273\243\345\256\242\344\270\213\345\215\225.py" | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git "a/air_case/cmdc_order_list/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.air/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.py" "b/air_case/cmdc_order_list/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.air/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.py" index dedf8ea0..dd83de5e 100644 --- "a/air_case/cmdc_order_list/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.air/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.py" +++ "b/air_case/cmdc_order_list/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.air/\350\216\267\345\217\226\347\224\250\346\210\267\351\273\230\350\256\244\345\234\260\345\235\200_\344\273\243\345\256\242\344\270\213\345\215\225.py" @@ -28,7 +28,7 @@ request_body = commonFuc().get_business_data(module, "payload33") # 发送请求 result = requests.post(url, json=request_body, headers=headers) result = json.loads(result.content) - +# print(result) # 生成随机数 customer_random = random.randint(0, len(result["data"]["list"]) - 1) # 获取客户信息 @@ -52,8 +52,10 @@ api_time = float(result.elapsed.total_seconds()) # 获取用户默认地址信息 result = json.loads(result.content) +# print(result) # 判断有些用户没有默认地址 if result["data"]: + is_default = result["data"][0]["isDefault"] result = {"addressId": result["data"][0]["addressId"]} # 将接口响应时间添加至结果中 result["api_time"] = api_time @@ -65,8 +67,11 @@ if result["data"]: # 查询数据库中对应的用户的默认地址 sql = "SELECT t.addressId FROM `cmdc-user`.cmdc_user_address t " \ - "WHERE userId = {} and companyId = {} and deleteSign = 0 and isDefault = 1".format(user_id, company_id) + "WHERE userId = {} and companyId = {} and deleteSign = 0 " \ + "and isDefault = {}".format(user_id, company_id, is_default) + # print(sql) address_id = mysql_handle.selectSql(host, port, user, pwd, "cmdc-user", sql)[0][0] + # print(address_id) # 获取预期结果 check_dict = commonFuc().get_business_data(module, "checkDict35", address_id) -- GitLab