Browse Source

warning: health update

ping 2 tháng trước cách đây
mục cha
commit
d0054e5f13

+ 2 - 0
module/backend/dashboard.go

@@ -56,6 +56,8 @@ func (s *StoreEntry) NeckRingWarning(ctx context.Context) (*pasturePb.IndexNeckR
 		countEstrusWarning += int(v.Count)
 		countEstrusWarning += int(v.Count)
 	}
 	}
 
 
+	zaplog.Info("NeckRingWarning", zap.Any("estrusWarningNumber", estrusWarningCowList), zap.Any("estrusWarningLevelItems", estrusWarningLevelItems))
+
 	abortionCount := int64(0)
 	abortionCount := int64(0)
 	pref, err = s.AbortionWarningQuery(ctx, userModel.AppPasture.Id)
 	pref, err = s.AbortionWarningQuery(ctx, userModel.AppPasture.Id)
 	if err != nil {
 	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)
 	neckWaringHealthList := make([]*model.NeckRingHealthWarning, 0)
 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.NeckRingHealthWarning).TableName())).
 	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")).
 		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 {
 	if len(req.PenIds) > 0 {
 		pref.Where("b.pen_id IN ?", req.PenIds)
 		pref.Where("b.pen_id IN ?", req.PenIds)