Browse Source

Merge branch 'develop' of xuyiping/kpt-pasture into master

xuyiping 5 days ago
parent
commit
4bbc9987fa
2 changed files with 2 additions and 2 deletions
  1. 1 1
      .drone.yml
  2. 1 1
      module/backend/cow.go

+ 1 - 1
.drone.yml

@@ -1,6 +1,6 @@
 kind: pipeline
 type: docker
-name: kptPasture
+name: kpt-pasture
 
 clone:
   depth: 1

+ 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)).