fix: progress.on_ac None 安全(day_done/streak_days NULL 初始化)
这个提交包含在:
@@ -33,9 +33,9 @@ class ProgressService:
|
|||||||
self.session.add(row)
|
self.session.add(row)
|
||||||
today = date.today()
|
today = date.today()
|
||||||
if row.last_ac_date != today:
|
if row.last_ac_date != today:
|
||||||
row.day_done += 1
|
row.day_done = (row.day_done or 0) + 1
|
||||||
if row.last_ac_date and (today - row.last_ac_date).days == 1:
|
if row.last_ac_date and (today - row.last_ac_date).days == 1:
|
||||||
row.streak_days += 1
|
row.streak_days = (row.streak_days or 0) + 1
|
||||||
elif row.last_ac_date != today:
|
elif row.last_ac_date != today:
|
||||||
row.streak_days = 1
|
row.streak_days = 1
|
||||||
row.last_ac_date = today
|
row.last_ac_date = today
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户