diff --git a/internal/data/repoimpl/product.go b/internal/data/repoimpl/product.go index 220b49c..01cbc00 100644 --- a/internal/data/repoimpl/product.go +++ b/internal/data/repoimpl/product.go @@ -32,12 +32,12 @@ func NewProductRepoImpl(db *data.Db, rdb *data.Rdb) repo.ProductRepo { } func (r *ProductRepoImpl) FindWarningBudget(ctx context.Context, fun func(ctx context.Context, rows []*bo.ProductBo) error) error { - var results = make([]*model.Product, 0) nowTime := time.Now().Format(time.DateTime) result := r.db.DB(ctx). + Select("DISTINCT batch_no, product.*"). Where("start_time < ?", nowTime). Where("end_time > ?", nowTime). Where("warning_budget > 0").