finish product list api
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"fusenapi/utils/image"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -94,14 +93,17 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, login
|
||||
//存储产品最小价格
|
||||
mapProductMinPrice := make(map[int64]int64)
|
||||
for _, v := range productPriceList {
|
||||
priceSlic := strings.Split(v.Price, ",")
|
||||
sort.Strings(priceSlic)
|
||||
min, err := strconv.ParseInt(priceSlic[0], 10, 64)
|
||||
priceStrSlic := strings.Split(v.Price, ",")
|
||||
priceSlice, err := format.StrSlicToIntSlice(priceStrSlic)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "parse min product price err"}, nil
|
||||
return &types.Response{Code: 510, Message: err.Error()}, nil
|
||||
}
|
||||
mapProductMinPrice[v.ProductId] = min
|
||||
if len(priceSlice) == 0 {
|
||||
continue
|
||||
}
|
||||
sort.Ints(priceSlice)
|
||||
mapProductMinPrice[v.ProductId] = int64(priceSlice[0])
|
||||
}
|
||||
//获取模板
|
||||
productTemplateModel := model.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
|
||||
|
||||
Reference in New Issue
Block a user