|
@@ -23,7 +23,7 @@ func (s *StoreEntry) CalvingCowList(ctx context.Context, req *pasturePb.ItemsReq
|
|
|
count := int64(0)
|
|
|
pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventCalving).TableName())).
|
|
|
Select(`a.id,a.cow_id,a.ear_number,a.status,b.breed_status,b.pen_id,ROUND(b.current_weight/1000,2) as current_weight,
|
|
|
- DATE_FORMAT(FROM_UNIXTIME(last_mating_at), '%Y-%m-%d') AS mating_at_format,b.day_age,b.last_bull_number as bull_id,
|
|
|
+ DATE_FORMAT(FROM_UNIXTIME(last_mating_at), '%Y-%m-%d') AS mating_at_format,b.day_age,b.last_bull_number as bull_id,b.lact,
|
|
|
b.pen_name,DATEDIFF(NOW(),FROM_UNIXTIME(last_mating_at)) AS mating_age,DATE_FORMAT(FROM_UNIXTIME(a.plan_day), '%Y-%m-%d') AS plan_day`).
|
|
|
Joins("left join cow as b on a.cow_id = b.id").
|
|
|
Where("a.status = ?", pasturePb.IsShow_No).
|