This commit is contained in:
苏尹岚
2021-02-08 09:27:53 +08:00
parent e6d3190691
commit fd6efea36e
3 changed files with 35 additions and 0 deletions

View File

@@ -3938,3 +3938,15 @@ func CreateVendorStore(ctx *jxcontext.Context, storeID, vendorID int, payload ma
} }
return err return err
} }
func GetBrandStore(ctx *jxcontext.Context, name string) (brands []*model.BrandStore, err error) {
var (
db = dao.GetDB()
)
sql := `
SELECT * FROM brand_store WHERE deleted_at = ? AND name LIKE ?
`
sqlParams := []interface{}{utils.DefaultTimeValue, "%" + name + "%"}
err = dao.GetRows(db, &brands, sql, sqlParams)
return brands, err
}

View File

@@ -1024,3 +1024,17 @@ func (c *StoreController) CreateVendorStore() {
return retVal, "", err return retVal, "", err
}) })
} }
// @Title 查询品牌店铺
// @Description 查询品牌店铺
// @Param token header string false "认证token"
// @Param name query string true "品牌名"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetBrandStore [get]
func (c *StoreController) GetBrandStore() {
c.callGetBrandStore(func(params *tStoreGetBrandStoreParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetBrandStore(params.Ctx, params.Name)
return retVal, "", err
})
}

View File

@@ -2088,6 +2088,15 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
beego.ControllerComments{
Method: "GetBrandStore",
Router: `/GetBrandStore`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"], beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "GetBrands", Method: "GetBrands",