from Utils.sql_handler import test_env_conn from TestData.homepage.homepage_test_data import homepageTestData customer_service_id_select_sql = f'select * from `rel_customerservice_brand` where brand_id = {homepageTestData.brandId}' customer_service_id_select_result = test_env_conn.select_many_value(sql=customer_service_id_select_sql) customer_id_list = tuple([cs['customer_service_id'] for cs in customer_service_id_select_result]) no_reply_room_select_sql = f'select * from `im_room` where cate_id = {homepageTestData.brandId} and last_msg_uid not in {customer_id_list} and room_type = 1 and is_ignore = 0 and status =1' no_reply_room_select_result = test_env_conn.select_many_value(sql=no_reply_room_select_sql) no_reply_num = len(no_reply_room_select_result) setattr(homepageTestData, 'no_reply_num', no_reply_num)