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 }