Documentation
¶
Index ¶
- func QueryCartListPromotion(ids []int64, ctx context.Context, svcCtx *svc.ServiceContext) []types.CarItemtPromotionListData
- type CarItemClearLogic
- type CarItemListLogic
- type CarItemtListPromotionLogic
- type CartItemAddLogic
- type CartItemDeleteLogic
- type CartProductLogic
- type CartUpdateAttrLogic
- type CartUpdateQuantityLogic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryCartListPromotion ¶
func QueryCartListPromotion(ids []int64, ctx context.Context, svcCtx *svc.ServiceContext) []types.CarItemtPromotionListData
QueryCartListPromotion 抽取单独方法(方便在下单确认的使用)
Types ¶
type CarItemClearLogic ¶
CarItemClearLogic
Author: LiuFeiHua Date: 2023/12/6 14:34
func NewCarItemClearLogic ¶
func NewCarItemClearLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CarItemClearLogic
func (*CarItemClearLogic) CarItemClear ¶
func (l *CarItemClearLogic) CarItemClear() (resp *types.CartItemClearResp, err error)
CarItemClear 清空购物车
type CarItemListLogic ¶
CarItemListLogic
Author: LiuFeiHua Date: 2023/11/30 16:36
func NewCarItemListLogic ¶
func NewCarItemListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CarItemListLogic
func (*CarItemListLogic) CarItemList ¶
func (l *CarItemListLogic) CarItemList() (resp *types.CartItemListResp, err error)
CarItemList 获取某个会员的购物车列表
type CarItemtListPromotionLogic ¶
CarItemtListPromotionLogic
Author: LiuFeiHua Date: 2023/12/6 16:18
func NewCarItemtListPromotionLogic ¶
func NewCarItemtListPromotionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CarItemtListPromotionLogic
func (*CarItemtListPromotionLogic) CarItemtListPromotion ¶
func (l *CarItemtListPromotionLogic) CarItemtListPromotion(req *types.CarItemListPromotionReq) (resp *types.CarItemtListPromotionResp, err error)
CarItemtListPromotion 获取某个会员的购物车列表,包括促销信息 1.获取会员购物车里面所有商品信息(根据会员id查询购物车所有商品,(表:oms_cart)) 2.判断是否会员选中购物车中的商品,如果没有就是会员购物车中所有有商品进行计算 3.先根据productId对CartItem进行分组,以spu为单位进行计算优惠 比如:购物车中有二台iphone15 pro max,其中一台是iphone15 pro max 是粉色,另外一台是黑色。{'productId':[iphone15 pro max 是粉色,iphone15 pro max 是黑色]} 4.查询所有商品的优惠相关信息(商品的促销信息,包括sku、打折优惠、满减优惠) 过滤出所有商品的id,查询表pms_product,pms_sku_stock,pms_product_ladder,pms_product_full_reduction 5.根据商品促销类型计算商品促销优惠价格 根据productId从第4步返回优惠列表中,查询出优惠信息 6.根据表pms_product中的promotionType字段判断优惠类型:促销类型:0->没有促销使用原价;1->使用促销价;2->使用会员价;3->使用阶梯价格;4->使用满减价格;5->限时购 6.1如果promotionType为0,没有促销使用原价 6.2如果promotionType为1,单品促销(商品原价-促销价) 从pms_sku_stock中获取price原价-单品促销价格pms_sku_stock中的promotionPrice字段,即可 6.3如果promotionType为2,会员价格 从pms_member_price表中查询 6.4如果promotionType为3,打折优惠(商品原价-折扣*商品原价) 从pms_sku_stock中获取price原价-折扣*商品原价(表pms_ladder),即可 6.5如果promotionType为4,满减, 6.5.1 计算分组中的总优惠金额 6.5.2 (商品原价/总价)*满减金额(平摊到每件商品上的优惠金额) 6.6如果promotionType为5,限时购 从sms_flash_promotion_product_relation表获取价格
type CartItemAddLogic ¶
CartItemAddLogic
Author: LiuFeiHua Date: 2023/12/6 15:46
func NewCartItemAddLogic ¶
func NewCartItemAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartItemAddLogic
func (*CartItemAddLogic) CartItemAdd ¶
func (l *CartItemAddLogic) CartItemAdd(req *types.CartItemAddReq) (resp *types.CartItemAddResp, err error)
CartItemAdd 添加商品进购物车
type CartItemDeleteLogic ¶
CartItemDeleteLogic
Author: LiuFeiHua Date: 2023/12/6 14:35
func NewCartItemDeleteLogic ¶
func NewCartItemDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartItemDeleteLogic
func (*CartItemDeleteLogic) CartItemDelete ¶
func (l *CartItemDeleteLogic) CartItemDelete(req *types.CartItemDeleteReq) (resp *types.CartItemDeleteResp, err error)
CartItemDelete 删除购物车中的某个商品
type CartProductLogic ¶
CartProductLogic
Author: LiuFeiHua Date: 2023/12/6 16:07
func NewCartProductLogic ¶
func NewCartProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartProductLogic
func (*CartProductLogic) CartProduct ¶
func (l *CartProductLogic) CartProduct(req *types.CartProductReq) (resp *types.CartProductResp, err error)
CartProduct 获取购物车中某个商品的规格,用于重选规格
type CartUpdateAttrLogic ¶
CartUpdateAttrLogic
Author: LiuFeiHua Date: 2023/12/6 15:58
func NewCartUpdateAttrLogic ¶
func NewCartUpdateAttrLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartUpdateAttrLogic
func (*CartUpdateAttrLogic) CartUpdateAttr ¶
func (l *CartUpdateAttrLogic) CartUpdateAttr(req *types.CartItemUpdateAttrReq) (resp *types.CartItemUpdateResp, err error)
CartUpdateAttr 修改购物车中商品的规格
type CartUpdateQuantityLogic ¶
CartUpdateQuantityLogic
Author: LiuFeiHua Date: 2023/12/6 15:15
func NewCartUpdateQuantityLogic ¶
func NewCartUpdateQuantityLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartUpdateQuantityLogic
func (*CartUpdateQuantityLogic) CartUpdateQuantity ¶
func (l *CartUpdateQuantityLogic) CartUpdateQuantity(req *types.CartItemUpdateQuantityReq) (resp *types.CartItemUpdateResp, err error)
CartUpdateQuantity 修改购物车中某个商品的数量