|
@@ -5,6 +5,7 @@ import json
|
|
import os
|
|
import os
|
|
|
|
|
|
from applications.log import logging
|
|
from applications.log import logging
|
|
|
|
+from applications.functions.date import generate_daily_strings, five_days_before
|
|
|
|
|
|
|
|
|
|
def read_single_file(filename):
|
|
def read_single_file(filename):
|
|
@@ -101,13 +102,19 @@ def title_mix(title_p, dt, trace_id):
|
|
:param title_p:
|
|
:param title_p:
|
|
:param dt: dt
|
|
:param dt: dt
|
|
"""
|
|
"""
|
|
- json_path = os.path.join(os.getcwd(), 'applications', 'static', dt)
|
|
|
|
- # 处理标题信息
|
|
|
|
- files = os.listdir(json_path)
|
|
|
|
- pq_files = [os.path.join(json_path, file) for file in files]
|
|
|
|
|
|
+ five_days_ago = five_days_before(ori_dt=dt)
|
|
|
|
+ days_list = generate_daily_strings(five_days_ago, dt)
|
|
|
|
+ L = []
|
|
|
|
+ for day_str in days_list:
|
|
|
|
+ json_path = os.path.join(os.getcwd(), 'applications', 'static', day_str)
|
|
|
|
+ # 处理标题信息
|
|
|
|
+ files = os.listdir(json_path)
|
|
|
|
+ for file in files:
|
|
|
|
+ if file.endswith(".json"):
|
|
|
|
+ L.append(os.path.join(json_path, file))
|
|
score_list_1 = []
|
|
score_list_1 = []
|
|
score_list_2 = []
|
|
score_list_2 = []
|
|
- for file in pq_files:
|
|
|
|
|
|
+ for file in L:
|
|
file_name = file.split('/')[-1].replace(".json", "")
|
|
file_name = file.split('/')[-1].replace(".json", "")
|
|
v_id = file_name.split('_')[1]
|
|
v_id = file_name.split('_')[1]
|
|
uid = file_name.split('_')[0]
|
|
uid = file_name.split('_')[0]
|