From 7cfaee0413efa8628525f25df5fb84fac15d24c4 Mon Sep 17 00:00:00 2001 From: ziming Date: Wed, 2 Jul 2025 14:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A633?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/data/repoimpl/product.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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").