修复:周统计数据需加入年份

This commit is contained in:
2022-09-23 17:56:39 +08:00
parent ef9592ef30
commit d7f3a21add

View File

@@ -20,7 +20,7 @@ class TimeableVisitRecord < ApplicationRecord
belongs_to :project
def self.build(project_id)
week = TimeableVisitRecord.find_or_create_by!(time: Date.today.cweek, project_id: project_id)
week = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y-%W"), project_id: project_id)
month = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y%m"), project_id: project_id)
return week, month