After the order exceeds a certain time, the user does not confirm the receipt of the goods, which requires the system to automatically complete the confirmation operation, that is, to change the status of the order. Do you have any good ideas?

after the order exceeds a certain time, the user does not confirm the receipt, so the system needs to automatically complete the confirmation operation, that is, to change the status of the order. Do you have any good ideas?

I have seen before that someone"s idea is to make a queue. For example, the idea of connecting the head of a snake to the tail of a snake means that you do not understand
now, please provide a good idea and method. Thank you ^ _ ^

.
Mar.03,2021

personally, I don't think we need a circular queue. There are PHP background processes on a regular basis (usually 10 seconds, either too long or too short) to read the database (CLI mode ha):

  1. order information is written to a task after the order is issued, which is the current time + automatic confirmation of receipt time
  2. PHP reads the task at that time and executes it

make a circular queue, for example, automatically confirm the order after 6 days. The queue can be Day1- > Day2- > Day3- > Day4- > Day5- > Day6- > Day1. If today is a new order for Day1, id is saved to Day6. Automatically execute all orders in the queue at a fixed time every day, and automatically confirm if there is no confirmation.


when each order is generated, set the order expiration time field, read the expired order periodically through scheduled tasks, and change its status if there is still no confirmation of receipt.


https://github.com/ouqiang/de.


A relatively simple method:
write a PHP method or function to do timeout withdrawal function, call it with cron, or call


when the user accesses the order list or details.

https://github.com/snower/forsun

create scheduled tasks for key with each order id, and automatically request to complete the order when it expires.

Menu