Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A用户将某商品X加入购物车,B用户再将X加入购物车会失败 #22

Closed
IsCaster opened this issue Mar 16, 2018 · 1 comment

Comments

@IsCaster
Copy link

No description provided.

@tumobi tumobi closed this as completed Mar 27, 2018
@syrahcava
Copy link

感谢作者开源的这份代码,不过个人感觉完整功能仅供大家参考,代码中还有好多需要考虑和完善的地方。你说的这个问题我发现原因应该在这里

// 代码文件: src->api->controller->cart.js->addAction()中
// 判断购物车中是否存在此规格商品
const cartInfo = await this.model('cart').where({goods_id: goodsId, product_id: productId}).find();

判断购物车中是否存在该条目时,没有加入当前用户的筛选条件,导致添加的商品永远会添加到默认存在的购物车记录中去。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants