From 1fb08e42d3d970086bf4394612685845c35a27c7 Mon Sep 17 00:00:00 2001 From: "qiyunfanbo126.com" <815699> Date: Wed, 10 Jul 2024 17:13:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/BrandService.go | 2 +- app/services/ProductService.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/BrandService.go b/app/services/BrandService.go index 78d1801..97900d6 100644 --- a/app/services/BrandService.go +++ b/app/services/BrandService.go @@ -5,6 +5,6 @@ import ( ) func MilkBrandList() (code int, brandData []brandmodel.Brand) { - err := brandmodel.GetInstance().GetDb().Where("state = ?", 1).OrderBy("brand_id asc").Find(&brandData) + err := brandmodel.GetInstance().GetDb().Where("state = ?", 1).OrderBy("id asc").Find(&brandData) return handErr(err), brandData } diff --git a/app/services/ProductService.go b/app/services/ProductService.go index 95ce799..29a8797 100644 --- a/app/services/ProductService.go +++ b/app/services/ProductService.go @@ -10,7 +10,7 @@ import ( func MilkProductList() (code int, productList []productsmodel.MilkProductsList) { err := productsmodel.GetInstance().GetDb().Alias("a"). Join("INNER", "brand b", "a.brand_id = b.id"). - Where("a.status = ?", 1).Find(&productList) + Where("a.status = ?", 1).OrderBy("brand_id asc").Find(&productList) return handErr(err), productList }