修复:周统计数据需加入年份
This commit is contained in:
parent
ef9592ef30
commit
d7f3a21add
|
@ -20,7 +20,7 @@ class TimeableVisitRecord < ApplicationRecord
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
|
||||||
def self.build(project_id)
|
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)
|
month = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y%m"), project_id: project_id)
|
||||||
|
|
||||||
return week, month
|
return week, month
|
||||||
|
|
Loading…
Reference in New Issue