fix
This commit is contained in:
parent
98bc6294e6
commit
c34811df83
|
@ -43,12 +43,13 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
|||
}
|
||||
currentPage := constants.DEFAULT_PAGE
|
||||
limit := 300
|
||||
if len(req.CartIds) > limit {
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "err param:request cart item is too much")
|
||||
}
|
||||
//获取用户购物车列表
|
||||
var cartIds []int64
|
||||
if req.CartId > 0 {
|
||||
cartIds = append(cartIds, req.CartId)
|
||||
}
|
||||
carts, total, err := l.svcCtx.AllModels.FsShoppingCart.GetAllCartsByParam(l.ctx, gmodel.GetAllCartsByParamReq{
|
||||
Ids: req.CartIds,
|
||||
Ids: cartIds,
|
||||
UserId: userinfo.UserId,
|
||||
Sort: "id DESC",
|
||||
Page: currentPage,
|
||||
|
|
|
@ -30,7 +30,7 @@ type DeleteCartReq struct {
|
|||
}
|
||||
|
||||
type GetCartsReq struct {
|
||||
CartIds []int64 `json:"cart_id,optional"` //购物车ids可选
|
||||
CartId int64 `form:"cart_id,optional"` //购物车ids可选
|
||||
}
|
||||
|
||||
type GetCartsRsp struct {
|
||||
|
|
|
@ -49,7 +49,7 @@ type DeleteCartReq {
|
|||
|
||||
//获取购物车列表
|
||||
type GetCartsReq {
|
||||
CartIds []int64 `json:"cart_id,optional"` //购物车ids可选
|
||||
CartId int64 `form:"cart_id,optional"` //购物车ids可选
|
||||
}
|
||||
type GetCartsRsp {
|
||||
Meta Meta `json:"meta"` //分页信息
|
||||
|
|
Loading…
Reference in New Issue
Block a user