Forráskód Böngészése

warning: health update

ping 2 hónapja
szülő
commit
d0054e5f13
2 módosított fájl, 5 hozzáadás és 1 törlés
  1. 2 0
      module/backend/dashboard.go
  2. 3 1
      module/backend/neck_ring_warning.go

+ 2 - 0
module/backend/dashboard.go

@@ -56,6 +56,8 @@ func (s *StoreEntry) NeckRingWarning(ctx context.Context) (*pasturePb.IndexNeckR
 		countEstrusWarning += int(v.Count)
 	}
 
+	zaplog.Info("NeckRingWarning", zap.Any("estrusWarningNumber", estrusWarningCowList), zap.Any("estrusWarningLevelItems", estrusWarningLevelItems))
+
 	abortionCount := int64(0)
 	pref, err = s.AbortionWarningQuery(ctx, userModel.AppPasture.Id)
 	if err != nil {

+ 3 - 1
module/backend/neck_ring_warning.go

@@ -96,7 +96,9 @@ func (s *StoreEntry) NeckRingWarningHealthCowList(ctx context.Context, req *past
 	neckWaringHealthList := make([]*model.NeckRingHealthWarning, 0)
 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.NeckRingHealthWarning).TableName())).
 		Joins(fmt.Sprintf("JOIN cow AS b on a.cow_id = b.id")).
-		Where("a.score >= ?", 0).Where("a.is_show = ?", pasturePb.IsShow_Ok)
+		Where("a.score >= ?", 0).
+		Where("a.is_show = ?", pasturePb.IsShow_Ok).
+		Where("a.pasture_id = ?", userModel.AppPasture.Id)
 
 	if len(req.PenIds) > 0 {
 		pref.Where("b.pen_id IN ?", req.PenIds)