增加配置

This commit is contained in:
qiyunfanbo126.com 2024-07-10 17:13:36 +08:00
parent aa2a157530
commit 1fb08e42d3
2 changed files with 2 additions and 2 deletions

View File

@ -5,6 +5,6 @@ import (
) )
func MilkBrandList() (code int, brandData []brandmodel.Brand) { 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 return handErr(err), brandData
} }

View File

@ -10,7 +10,7 @@ import (
func MilkProductList() (code int, productList []productsmodel.MilkProductsList) { func MilkProductList() (code int, productList []productsmodel.MilkProductsList) {
err := productsmodel.GetInstance().GetDb().Alias("a"). err := productsmodel.GetInstance().GetDb().Alias("a").
Join("INNER", "brand b", "a.brand_id = b.id"). 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 return handErr(err), productList
} }