Parcourir la source

查询特卖商品列表接口更新参数

zhou.xiaoning il y a 4 ans
Parent
commit
34d19814a7
2 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 2 2
      controllers/hsby/hsby.go
  2. 3 3
      models/hsby.go

+ 2 - 2
controllers/hsby/hsby.go

@@ -1049,7 +1049,7 @@ type QueryHsbyMarketGoodsesReq struct {
 	MarketIDs  string `form:"marketIDs" binding:"required"`
 	AccountID  int    `form:"accountID"`
 	CategoryID int    `form:"categoryID"`
-	GoodsID    int    `form:"goodsID"`
+	GoodsIDs   string `form:"goodsIDs"`
 }
 
 // QueryHsbyMarketGoodses 查询特卖商品列表(三级商城)
@@ -1061,7 +1061,7 @@ type QueryHsbyMarketGoodsesReq struct {
 // @Param marketIDs query string true "市场ID列表,格式:1,2,3"
 // @Param accountID query int false "资金账户,主要用于判断商品是否有可用的优惠卷;如未登录可不传。"
 // @Param categoryID query int false "类别ID"
-// @Param goodsID query int false "商品ID"
+// @Param goodsIDs query string false "商品ID列表,格式:1,2,3"
 // @Success 200 {object} models.HsbyMarketGoods
 // @Failure 500 {object} app.Response
 // @Router /HSBY/QueryHsbyMarketGoodses [get]

+ 3 - 3
models/hsby.go

@@ -1412,7 +1412,7 @@ type HsbyMarketGoods struct {
 }
 
 // GetHsbyMarketGoodses 获取商城商品列表(三级商城)
-func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID, goodsID int) ([]HsbyMarketGoods, error) {
+func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID int, goodsIDs string) ([]HsbyMarketGoods, error) {
 	engine := db.GetEngine()
 
 	orders := make([]HsbyMarketGoods, 0)
@@ -1435,8 +1435,8 @@ func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID, goodsID int)
 	if categoryID != 0 {
 		session = session.And("GX.CATEGORYID = ?", categoryID)
 	}
-	if goodsID != 0 {
-		session = session.And("G.GOODSID = ?", goodsID)
+	if len(goodsIDs) > 0 {
+		session = session.And(fmt.Sprintf("G.GOODSID in (%s)", goodsIDs))
 	}
 	if err := session.Find(&orders); err != nil {
 		return nil, err