diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index c21eba04e..2fcea1c63 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3775,8 +3775,8 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err return err } -func GetBrands(ctx *jxcontext.Context, name string) (brands []*model.Brand, err error) { - return dao.GetBrands(dao.GetDB(), name) +func GetBrands(ctx *jxcontext.Context, name string, brandID int) (brands []*model.Brand, err error) { + return dao.GetBrands(dao.GetDB(), name, brandID) } func AddBrand(ctx *jxcontext.Context, brand *model.Brand) (err error) { diff --git a/business/model/dao/store.go b/business/model/dao/store.go index afe55204b..75db62ced 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -926,7 +926,7 @@ func GetStoreAuditPage(db *DaoDB, statuss []int, keyword string, applyTimeStart, return pagedInfo, err } -func GetBrands(db *DaoDB, name string) (brands []*model.Brand, err error) { +func GetBrands(db *DaoDB, name string, brandID int) (brands []*model.Brand, err error) { sql := ` SELECT * FROM brand @@ -939,6 +939,10 @@ func GetBrands(db *DaoDB, name string) (brands []*model.Brand, err error) { sql += " AND name LIKE ?" sqlParams = append(sqlParams, "%"+name+"%") } + if brandID != 0 { + sql += " AND id = ?" + sqlParams = append(sqlParams, brandID) + } err = GetRows(db, &brands, sql, sqlParams) return brands, err } diff --git a/business/model/user.go b/business/model/user.go index f78cb0489..0a6dc1add 100644 --- a/business/model/user.go +++ b/business/model/user.go @@ -57,6 +57,7 @@ type User struct { LastLoginAt *time.Time `orm:"null" json:"lastLoginAt"` LastLoginIP string `orm:"size(64);column(last_login_ip)" json:"lastLoginIP"` LastLoginType string `orm:"size(16)" json:"lastLoginType"` + LastBrandID int `orm:"column(last_brand_id)" json:"lastBrandID"` ParentMobile string `orm:"size(32)" json:"parentMobile"` DividePercentage int `json:"dividePercentage"` diff --git a/controllers/cms_store.go b/controllers/cms_store.go index 0c8a2d273..3f5334ea3 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -943,13 +943,14 @@ func (c *StoreController) GetJddjStoreInfo() { // @Title 查询品牌 // @Description 查询品牌 // @Param token header string true "认证token" +// @Param brandID query int false "品牌ID" // @Param name query string false "品牌名" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /GetBrands [get] func (c *StoreController) GetBrands() { c.callGetBrands(func(params *tStoreGetBrandsParams) (retVal interface{}, errCode string, err error) { - retVal, err = cms.GetBrands(params.Ctx, params.Name) + retVal, err = cms.GetBrands(params.Ctx, params.Name, params.BrandID) return retVal, "", err }) }