Browse Source

flask_app: 增加原始值的返回

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
79b668d16f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      flask_app.py

+ 5 - 1
flask_app.py

@@ -175,6 +175,7 @@ class Mvp:
         return [x[0] for x in age_info if x[0] is not None]
 
     def city_age_crowd(self, city=None, age=None, crowd=None):
+        data_start = []
         result = []
         if city is not None and age is not None and crowd is not None:
             print('获取指定城市,年龄段,人群类型的数据...')
@@ -182,6 +183,7 @@ class Mvp:
             if len(people_uuids) > 0:
                 print('{}-{}-{}'.format(city, age, crowd))
                 datas = self.behavior_tag_init(city, age, people_uuids)
+                data_start.extend(datas)
                 result.extend(self.calculation_standard_score(datas, city, age, crowd))
             pass
         else:
@@ -195,8 +197,10 @@ class Mvp:
                             if len(people_uuids) > 0:
                                 print('{}-{}-{}'.format(city, age, crowd_type))
                                 datas = self.behavior_tag_init(city, age, people_uuids)
+                                data_start.extend(datas)
                                 result.extend(self.calculation_standard_score(datas, city, age, crowd_type))
-        return result
+        # return result
+        return {'分数': result, '原始值': data_start}
 
     def behavior_tag_init(self, city, age, people_uuids):
         result = {}