mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
[FIX/BE-US] fix uniformity relation chickin date
This commit is contained in:
@@ -375,7 +375,7 @@ func (s *uniformityService) CreateOne(c *fiber.Ctx, req *validation.Create, file
|
||||
var latestWeek int
|
||||
if err := s.Repository.DB().WithContext(c.Context()).
|
||||
Model(&entity.ProjectFlockKandangUniformity{}).
|
||||
Where("project_flock_kandang_id = ? AND deleted_at IS NULL", req.ProjectFlockKandangId).
|
||||
Where("project_flock_kandang_id = ?", req.ProjectFlockKandangId).
|
||||
Select("COALESCE(MAX(week), 0)").
|
||||
Scan(&latestWeek).Error; err != nil {
|
||||
return nil, fiber.NewError(fiber.StatusInternalServerError, "Failed to validate uniformity week sequence")
|
||||
|
||||
Reference in New Issue
Block a user