mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
adjust calculate umur ayam at recording
This commit is contained in:
@@ -2460,7 +2460,7 @@ func (s *recordingService) computeRecordingDay(ctx context.Context, projectFlock
|
||||
return 0, fiber.NewError(fiber.StatusBadRequest, "Record date tidak boleh sebelum tanggal chick in")
|
||||
}
|
||||
|
||||
return diff + 1, nil
|
||||
return diff, nil
|
||||
}
|
||||
|
||||
func (s *recordingService) computeAndUpdateMetrics(ctx context.Context, tx *gorm.DB, recording *entity.Recording) error {
|
||||
@@ -2621,8 +2621,8 @@ func (s *recordingService) computeAndUpdateMetrics(ctx context.Context, tx *gorm
|
||||
|
||||
if isGrowing {
|
||||
week := 0
|
||||
if recording.Day != nil && *recording.Day > 0 {
|
||||
week = (*recording.Day-1)/7 + 1
|
||||
if recording.Day != nil && *recording.Day >= 0 {
|
||||
week = *recording.Day/7 + 1
|
||||
}
|
||||
if week > 0 && s.Repository != nil {
|
||||
meanBw, ok, err := s.Repository.GetUniformityMeanBwByWeek(tx, recording.ProjectFlockKandangId, week)
|
||||
|
||||
Reference in New Issue
Block a user