电商 - 如何用 mysql 定时任务 处理订单超时 库存释放的问题?
高洛峰
高洛峰 2017-04-17 15:07:37
0
2
626
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
巴扎黑

2 sets of plans:
Plan 1: Self-closing:
is to add a closing operation in the two stages of browsing the product and the customer browsing the order. Roughly speaking, every time you browse a product, you will find all unpaid orders for the product, which were created less than 15 minutes ago. . Close and add inventory; browse your order page and close all your orders placed 15 minutes ago~~

Option 2: Scheduled shutdown of the system:
Every time an order is created, a command is pushed to the queue to be executed in 15 minutes, and the command is closed after the payment is completed.
If this command is still alive after 15 minutes, then check the corresponding order. If payment has not been made, close it~

This is the plan. Mysql itself cannot implement the timing function.
But you need 2 sets of detailed sql statements for the plan. . Let’s ask again. It’s relatively simple and the needs are different, so I won’t bother to comment

黄舟

First use Visio to draw a flow chart.

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!