|
@@ -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)
|