fix post log

This commit is contained in:
lwl0608 2024-07-01 15:33:44 +08:00
parent 0db6153ce6
commit 9463fbe477
1 changed files with 21 additions and 3 deletions

View File

@ -41,11 +41,24 @@ group by t1.mid,t1.ymd
mid_docs_map[mid].append(doc)
print("week, len(mid_docs_map): {}".format(len(mid_docs_map)))
ymds = list()
while True:
if st >= et:
break
ymds.append(get_time_str_by_ts_v2(st, "%Y%m%d"))
st += 86400
reqs = list()
for mid, docs in mid_docs_map.items():
q = {"_id": mid}
lis = list()
ymd_doc_map = dict()
for d in docs:
ymd = safe_get_str(d, "ymd")
ymd_doc_map[ymd] = d
lis = list()
for ymd in ymds:
d = safe_get_dict(ymd_doc_map, ymd)
lis.append({
"date": safe_get_str(d, "ymd"),
"income": safe_get_int(d, "income")
@ -117,6 +130,11 @@ group by t1.mid,t1.type_id
self.get_week_dashboard()
self.get_income_from_dashboard()
# s = S()
# s.proc()
s = S()
s.proc()
et = get_today_zero_time()
st = et - 7 * 86400
print(ymds)