javascript - 购物车模块的业务逻辑

WBOY
Release: 2016-06-06 20:14:05
Original
1594 people have browsed it

在线求一个类似京东或者淘宝的购物车模块业务逻辑或者示例!
像用户未登录和已登陆两种情况的购物车数据处理是如何,存在什么地方
求大神给些思路或者示例

回复内容:

在线求一个类似京东或者淘宝的购物车模块业务逻辑或者示例!
像用户未登录和已登陆两种情况的购物车数据处理是如何,存在什么地方
求大神给些思路或者示例

都一样,存在session里

key-value的数据库里,未登录就生成个匿名用户ID保存,登录后2条记录合并

登录状态直接写入数据库中。
未登录状态将信息写入redis(作缓存)中,登录后获取redis中信息进行持久化操作即可

入数据库就行,不登录的时候以session作为标识,登录的时候以user_id作为标识。

具体实现直接百度
思路就是存进一个存储库中(nosql,mysql,session)推荐redis,比其他三个都快

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!