소스 검색

mvp: 人群分类信息获取逻辑修改

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 년 전
부모
커밋
d08fbbe03e
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      mvp.py

+ 6 - 4
mvp.py

@@ -249,18 +249,20 @@ class Mvp:
         for people in people_info_city:
         for people in people_info_city:
             uuid = people[0]
             uuid = people[0]
             city = people[1]
             city = people[1]
+            nld = people[2]
             sex = people[3]
             sex = people[3]
             sub_option_ids = people[4]
             sub_option_ids = people[4]
             testcaseid = people[5]
             testcaseid = people[5]
+
             if str(city).strip():
             if str(city).strip():
                 city = str(city).split('市')[0] + '市'
                 city = str(city).split('市')[0] + '市'
-            nld = people[2]
+
             if str(nld).strip():
             if str(nld).strip():
-                nld_1 = list(str(people[2]).split(','))
+                nld_1 = list(str(nld).split(','))
                 if len(nld) > 0:
                 if len(nld) > 0:
                     nld_1 = nld[0]
                     nld_1 = nld[0]
             else:
             else:
-                nld_1 = ''
+                nld_1 = '无年龄'
 
 
             testcastids = list(map(int, str(testcaseid).split(',')))
             testcastids = list(map(int, str(testcaseid).split(',')))
             gt_75 = [x for x in testcastids if x > 75]
             gt_75 = [x for x in testcastids if x > 75]
@@ -298,7 +300,7 @@ class Mvp:
             type_sub_option_ids = self.crowd_contain_sub_option_ids[key]
             type_sub_option_ids = self.crowd_contain_sub_option_ids[key]
             sub_option_ids = list(map(int, str(sub_option_ids).split(',')))
             sub_option_ids = list(map(int, str(sub_option_ids).split(',')))
             # list(set(a).intersection(set(b)))
             # list(set(a).intersection(set(b)))
-            if len(list(set(sub_option_ids).intersection(set(type_sub_option_ids)))) > 0 and key not in type:
+            if len(list(set(sub_option_ids).intersection(set(type_sub_option_ids)))) > 0 and key not in types:
                 types.append(key)
                 types.append(key)
         return types
         return types