|
@@ -51,7 +51,7 @@ func (s *StoreEntry) NeckRingWarningEstrusOrAbortionCowList(ctx context.Context,
|
|
|
}
|
|
|
|
|
|
if err = pref.Group("a.cow_id").
|
|
|
- Order("a.level DESC").
|
|
|
+ Order("a.date_time,a.level DESC").
|
|
|
Count(&count).
|
|
|
Limit(int(pagination.PageSize)).
|
|
|
Offset(int(pagination.PageOffset)).
|
|
@@ -81,12 +81,15 @@ func (s *StoreEntry) NeckRingWarningEstrusOrAbortionCowList(ctx context.Context,
|
|
|
}
|
|
|
|
|
|
list := model.NeckRingEstrusWarningSlice(neckRingEstrusList).ToPB(cowMap, eventLogMap, req.MatingWindowPeriod)
|
|
|
+ if req.MatingWindowPeriod > 0 {
|
|
|
+ count = int64(len(list))
|
|
|
+ }
|
|
|
return &pasturePb.EstrusResponse{
|
|
|
Code: http.StatusOK,
|
|
|
Msg: "ok",
|
|
|
Data: &pasturePb.EstrusData{
|
|
|
List: list,
|
|
|
- Total: int32(len(list)),
|
|
|
+ Total: int32(count),
|
|
|
PageSize: pagination.PageSize,
|
|
|
Page: pagination.Page,
|
|
|
},
|