From 50429714720369ca0c049ff6327b4693da26f5dc Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 20 Sep 2023 15:52:34 +0800 Subject: [PATCH] 11 --- model/gmodel/fs_product_price_logic.go | 1 + model/gmodel/fs_shopping_cart_logic.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/model/gmodel/fs_product_price_logic.go b/model/gmodel/fs_product_price_logic.go index a4bee9cd..be67f0de 100755 --- a/model/gmodel/fs_product_price_logic.go +++ b/model/gmodel/fs_product_price_logic.go @@ -24,6 +24,7 @@ func (p *FsProductPriceModel) GetSimplePriceListByProductIds(ctx context.Context return } func (p *FsProductPriceModel) GetPriceListByProductIdsSizeIds(ctx context.Context, productIds, sizeIds []int64) (resp []FsProductPrice, err error) { + if len(sizeIds) == 0 || len(productIds) == 0 { return } diff --git a/model/gmodel/fs_shopping_cart_logic.go b/model/gmodel/fs_shopping_cart_logic.go index 83a9b1d4..2e6da87d 100644 --- a/model/gmodel/fs_shopping_cart_logic.go +++ b/model/gmodel/fs_shopping_cart_logic.go @@ -85,7 +85,7 @@ func (s *FsShoppingCartModel) Create(ctx context.Context, data *FsShoppingCart) } // 删除 -func (s *FsShoppingCartModel) Delete(ctx context.Context, id, userId int64) error { +func (s *FsShoppingCartModel) Delete(ctx context.Context, userId, id int64) error { return s.db.WithContext(ctx).Model(&FsShoppingCart{}).Where("user_id = ? and id = ?", userId, id).Delete(&FsShoppingCart{}).Error }