This commit is contained in:
laodaming
2023-10-08 18:00:21 +08:00
parent af35164fb2
commit 8d4901cdcd
4 changed files with 37 additions and 34 deletions

View File

@@ -242,17 +242,18 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
snapshotJsonStr := string(snapshotJsonBytes)
now := time.Now().UTC()
err = l.svcCtx.AllModels.FsShoppingCart.Create(l.ctx, &gmodel.FsShoppingCart{
UserId: &userinfo.UserId,
ProductId: &req.ProductId,
TemplateId: &req.TemplateId,
ModelId: &modelInfo.Id,
LightId: modelInfo.Light,
SizeId: &req.SizeId,
FittingId: &req.FittingId,
PurchaseQuantity: &req.PurchaseQuantity,
Snapshot: &snapshotJsonStr,
Ctime: &now,
Utime: &now,
UserId: &userinfo.UserId,
ProductId: &req.ProductId,
TemplateId: &req.TemplateId,
ModelId: &modelInfo.Id,
IsHighlyCustomized: &req.IsHighlyCustomized,
LightId: modelInfo.Light,
SizeId: &req.SizeId,
FittingId: &req.FittingId,
PurchaseQuantity: &req.PurchaseQuantity,
Snapshot: &snapshotJsonStr,
Ctime: &now,
Utime: &now,
})
if err != nil {
logx.Error(err)

View File

@@ -197,7 +197,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
PurchaseQuantity: *cart.PurchaseQuantity,
MinPurchaseQuantity: stepPrice.MinBuyUnitsNum,
StepPurchaseQuantity: stepPurchaseQuantity,
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
IsHighlyCustomized: *cart.IsHighlyCustomized,
IsSelected: cartIsSelected,
TemplateTag: templateTag,
Logo: snapShot.Logo,