|
@@ -54,6 +54,13 @@ func (e *Entry) EntryCowEstrus(pastureId int64) (err error) {
|
|
|
if err = e.CowEstrusWarning(pastureId, xToday); err != nil {
|
|
|
zaplog.Error("EntryCowEstrus", zap.Any("CowEstrusWarning", err), zap.Any("xToday", xToday))
|
|
|
}
|
|
|
+
|
|
|
+ // 将历史发情预警数据更新为已过期
|
|
|
+ if err = e.DB.Model(new(model.EventEstrus)).
|
|
|
+ Where("estrus_start_date >= ?", time.Now().AddDate(0, 0, -4).Format(model.LayoutTime)).
|
|
|
+ Update("is_show", pasturePb.IsShow_No).Error; err != nil {
|
|
|
+ zaplog.Error("EntryCowEstrus", zap.Any("UpdateEventEstrus", err))
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
|