购物车问题 [英] Shopping Cart Problem

查看:74
本文介绍了购物车问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个场景.假设库存商品数量为1,然后有两个用户同时将产品添加到购物车中,那么哪个用户应该获得该产品,哪个用户应该得到该商品的消息,即没有库存,或者还有其他我应该做的事情吗?

我不需要任何代码.我只需要逻辑上的帮助.我自己做编码.

感谢您的帮助.

Hi all,

I have a scenario. Suppose that item quantity in stock is 1 and then two users add the product to cart simultaneously then which user should get the product and which user should get the message of items having not in stock or is there something else that I should do?

I don''t want any code. I just need help with the logic. I''ll do the coding by myself.

Thanks for the help.

推荐答案

我的建议是,您可以将购买该产品的时间最多花费几秒钟.即使它们也很相似,您也可以根据他们登录的时间确定优先级.
希望这会有所帮助.
My Suggestion is that u can use the time of purchase of that product upto seconds. even that too are similar u can prioritize based on time they logged in.
hope this will be helpful.


这篇关于购物车问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆