|
@@ -14,7 +14,6 @@ type RewardRule struct { |
|
@@ -14,7 +14,6 @@ type RewardRule struct { |
|
14
|
FaultNum int `json:"faultNum"`
|
14
|
FaultNum int `json:"faultNum"`
|
|
15
|
FaultAmount string `json:"faultAmount"`
|
15
|
FaultAmount string `json:"faultAmount"`
|
|
16
|
Remark string `json:"remark"`
|
16
|
Remark string `json:"remark"`
|
|
17
|
- IsBackup int `json:"IsBackup"` //是否作为备份遗留的 0 否 1 是
|
|
|
|
18
|
CreatedAt time.Time
|
17
|
CreatedAt time.Time
|
|
19
|
UpdatedAt time.Time
|
18
|
UpdatedAt time.Time
|
|
20
|
}
|
19
|
}
|
|
@@ -42,12 +41,3 @@ func (m *RewardRule) ValidFaultTag() bool { |
|
@@ -42,12 +41,3 @@ func (m *RewardRule) ValidFaultTag() bool { |
|
42
|
}
|
41
|
}
|
|
43
|
return true
|
42
|
return true
|
|
44
|
} |
43
|
} |
|
45
|
-
|
|
|
|
46
|
-// 编辑 奖惩标准时 ,是否需要将旧数据做备份处理
|
|
|
|
47
|
-func (m *RewardRule) NeedMakeBackup() bool {
|
|
|
|
48
|
- // 当前时间与 数据最后更新的时间 不是同一天时
|
|
|
|
49
|
- // 备份数据
|
|
|
|
50
|
- updateAt := m.UpdatedAt.Local().Format("2006-01-02")
|
|
|
|
51
|
- nowDate := time.Now().Format("2006-01-02")
|
|
|
|
52
|
- return !(updateAt == nowDate)
|
|
|
|
53
|
-} |
|
|