Browse Source

Merge branch 'feature/event' into develop

Yi 3 ngày trước cách đây
mục cha
commit
156ac5f0b0
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      module/backend/cow.go

+ 1 - 1
module/backend/cow.go

@@ -325,7 +325,7 @@ func (s *StoreEntry) BehaviorCurve(ctx context.Context, req *pasturePb.CowBehavi
 	// 发情数据
 	estrusList := make([]*model.NeckRingEstrus, 0)
 	if err = s.DB.Model(new(model.NeckRingEstrus)).
-		Select("id,active_level,active_time,is_peak").
+		Select("id,active_level,MAX(active_time) AS active_time,is_peak").
 		Where("cow_id = ?", cowInfo.Id).
 		Where("pasture_id = ?", userModel.AppPasture.Id).
 		Where("active_time BETWEEN ? AND ?", fmt.Sprintf("%s 00:00:00", startDataTime), fmt.Sprintf("%s 23:59:59", endDataTime)).