|
@@ -75,7 +75,7 @@ class Mvp:
|
|
|
def __init__(self, path=None):
|
|
|
self.shangju_db = MysqlDB('shangju')
|
|
|
self.marketing_db = MysqlDB('bi_report')
|
|
|
- self.shangju_db.truncate('mvp_standard_score')
|
|
|
+ # self.shangju_db.truncate('mvp_standard_score')
|
|
|
self.tag_data = ExcelUtil(path=path).init_mvp_data()
|
|
|
self.crowd_info = ExcelUtil(path=path, sheet_name='选项-人群分类对应表').init_crowd_info()
|
|
|
self.citys = self.init_city()
|
|
@@ -419,6 +419,8 @@ def behavioral_statistics():
|
|
|
print(city, age, crowd)
|
|
|
mvp = Mvp()
|
|
|
scores = mvp.write_tag(city, age, crowd)
|
|
|
+ mvp.shangju_db.close()
|
|
|
+ mvp.marketing_db.close()
|
|
|
return json.dumps(scores, ensure_ascii=False)
|
|
|
|
|
|
|
|
@@ -426,6 +428,8 @@ def behavioral_statistics():
|
|
|
def get_city_age_crowd():
|
|
|
mvp = Mvp()
|
|
|
infos = {'城市': mvp.citys, '年龄段': mvp.age}
|
|
|
+ mvp.shangju_db.close()
|
|
|
+ mvp.marketing_db.close()
|
|
|
return json.dumps(infos, ensure_ascii=False)
|
|
|
|
|
|
|