This commit is contained in:
laodaming
2023-06-05 17:13:05 +08:00
parent dfe171ea94
commit 52cc2a3d30
5 changed files with 148 additions and 8 deletions

View File

@@ -125,6 +125,13 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, login
if tagInfo == nil {
return &types.Response{Code: 510, Message: "classification not exists "}, nil
}
//获取产品尺寸数量
productSizeModel := model.NewFsProductSizeModel(l.svcCtx.MysqlConn)
productSizeCount, err := productSizeModel.CountByStatus(l.ctx, 1)
if err != nil {
logx.Error(err)
return &types.Response{Code: 510, Message: "get product size count err "}, nil
}
//拼接返回
itemList := make([]types.Items, 0, productLen)
for _, v := range productList {
@@ -147,7 +154,7 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, login
CoverImg: v.CoverImg,
IsEnv: v.IsProtection,
IsMicro: v.IsMicrowave,
SizeNum: 1, //????????????????
SizeNum: uint32(productSizeCount),
MiniPrice: format.CentoDollar(minPrice),
}
if req.Size > 0 {