Browse Source

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

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
d08fbbe03e
1 changed files with 6 additions and 4 deletions
  1. 6 4
      mvp.py

+ 6 - 4
mvp.py

@@ -249,18 +249,20 @@ class Mvp:
         for people in people_info_city:
             uuid = people[0]
             city = people[1]
+            nld = people[2]
             sex = people[3]
             sub_option_ids = people[4]
             testcaseid = people[5]
+
             if str(city).strip():
                 city = str(city).split('市')[0] + '市'
-            nld = people[2]
+
             if str(nld).strip():
-                nld_1 = list(str(people[2]).split(','))
+                nld_1 = list(str(nld).split(','))
                 if len(nld) > 0:
                     nld_1 = nld[0]
             else:
-                nld_1 = ''
+                nld_1 = '无年龄'
 
             testcastids = list(map(int, str(testcaseid).split(',')))
             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]
             sub_option_ids = list(map(int, str(sub_option_ids).split(',')))
             # 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)
         return types