PHP order dispatch system
A峰
A峰 2020-07-15 23:26:35
0
2
1904

Help! ! Now I want to make a system. After the user places an order successfully, the system will compare the longitude and latitude of the rider with the longitude and latitude of the delivery address. Whichever rider is closest to the delivery address will send the order to the nearest rider. ! ! The above is the requirement; the following is my idea: the front end polls one of my rider pool interfaces, uses redis hash to save the longitude and latitude information of all riders, and the other interface is the order dispatch interface that the rider side wants to poll. This interface is mainly Take out the longitude and latitude of all riders saved by redis, loop through all the rider's longitude and latitude to calculate the shortest distance to the order's longitude and latitude, and then write the nearest rider's information and order information into the dispatch data table. If there is rider information in the dispatch data table, , it prompts the rider to let the rider take the order! ! Can someone please take a look at my thinking? Please give me some advice

A峰
A峰

reply all(1)
All is well

If there are many riders, the pressure on the server will be too great

  • reply I only think of this idea when dispatching orders here. Is there any other good ideas?
    A峰 author 2020-07-24 08:27:56
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template