search

Home  >  Q&A  >  body text

PHP order dispatch system

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峰1603 days ago1895

reply all(2)I'll reply

  • All is well

    All is well2020-07-23 10:28:30

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

    reply
    0
  • A峰

    I only think of this idea when dispatching orders here. Is there any other good ideas?

    A峰 · 2020-07-24 08:27:56
  • Cancelreply