| 
															
																@@ -238,28 +238,27 @@ class Mvp: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 pass 
															 | 
															
															 | 
															
																                 pass 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             crowd = [] 
															 | 
															
															 | 
															
																             crowd = [] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if str(testcaseid).find(',') != -1: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                testcastids = list(map(int, str(testcaseid).split(','))) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if len(testcastids) > 0: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    gt_75 = [x for x in testcastids if x in [75, 76, 77, 78]] 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if city is None and len(gt_75) > 0: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        # 从答题结果中获取城市信息 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        citys = self.marketing_db.select(self.sql_16, [uuid]) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        if len(citys) > 0: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            city = citys[0][1] 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        else: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            city = '无城市' 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            # 根据用户子选项id集合,获取用户的人群分类 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if len(gt_75) > 0: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        # 特定的测试人群分类从答题结果中获取 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        sub_option_ids = self.marketing_db.select(self.sql_17, [uuid]) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        for option in sub_option_ids: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            crowd_type = self.crowd_info_1.get(option[1]) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            if crowd_type: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                crowd.append(crowd_type) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            testcastids = list(map(int, str(testcaseid).split(','))) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if len(testcastids) > 0: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                gt_75 = [x for x in testcastids if x in [75, 76, 77, 78]] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if city is None and len(gt_75) > 0: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    # 从答题结果中获取城市信息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    citys = self.marketing_db.select(self.sql_16, [uuid]) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if len(citys) > 0: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        city = citys[0][1] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     else: 
															 | 
															
															 | 
															
																                     else: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        if str(sub_option_ids_1).find(',') != -1: 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            crowd.extend(self.get_people_uuid_by_sub_option_ids(sub_option_ids_1)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        city = '无城市' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        # 根据用户子选项id集合,获取用户的人群分类 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if len(gt_75) > 0: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    # 特定的测试人群分类从答题结果中获取 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    sub_option_ids = self.marketing_db.select(self.sql_17, [uuid]) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    for option in sub_option_ids: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        crowd_type = self.crowd_info_1.get(option[1]) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        if crowd_type: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            crowd.append(crowd_type) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                else: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if str(sub_option_ids_1).find(',') != -1: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        crowd.extend(self.get_people_uuid_by_sub_option_ids(sub_option_ids_1)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if city is None: 
															 | 
															
															 | 
															
																             if city is None: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 city = '无城市' 
															 | 
															
															 | 
															
																                 city = '无城市' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             people_info = PeopleInfo(uuid, city, nld, sex, crowd) 
															 | 
															
															 | 
															
																             people_info = PeopleInfo(uuid, city, nld, sex, crowd) 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -467,6 +466,8 @@ class Mvp: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         result = [] 
															 | 
															
															 | 
															
																         result = [] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         module_scores = [] 
															 | 
															
															 | 
															
																         module_scores = [] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         self.people_info_1 = self.people_info() 
															 | 
															
															 | 
															
																         self.people_info_1 = self.people_info() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        for people in self.people_info_1: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            print(people.uuid, people.age, people.crowd, people.city, people.sex) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         if city is not None and age is not None and crowd is not None: 
															 | 
															
															 | 
															
																         if city is not None and age is not None and crowd is not None: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             print('获取指定城市,年龄段,人群类型的数据...') 
															 | 
															
															 | 
															
																             print('获取指定城市,年龄段,人群类型的数据...') 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             # people_uuids = self.get_people_uuid_by_type(crowd) 
															 | 
															
															 | 
															
																             # people_uuids = self.get_people_uuid_by_type(crowd) 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -656,9 +657,9 @@ class Mvp: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         sub_option_id, sub_question_id, content = qr[0], qr[1], qr[2] 
															 | 
															
															 | 
															
																                         sub_option_id, sub_question_id, content = qr[0], qr[1], qr[2] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         sub_option_ids.append(int(sub_option_id)) 
															 | 
															
															 | 
															
																                         sub_option_ids.append(int(sub_option_id)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             infos[key] = sub_option_ids 
															 | 
															
															 | 
															
																             infos[key] = sub_option_ids 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-        print(infos) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         return infos 
															 | 
															
															 | 
															
																         return infos 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 if __name__ == '__main__': 
															 | 
															
															 | 
															
																 if __name__ == '__main__': 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    print('{}哈{}ha%s'.format('1', '2')) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    mvp = Mvp() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    mvp.people_info() 
															 |