In laravel, the inventory sql of each sub-warehouse is dynamically calculated according to the warehouse table.

1. At present, we are working on a page to calculate the inventory of the warehouse. The
page is as follows:

clipboard.png

:


idwarehouse_id
clipboard.png
product_idid
clipboard.png

that way, when a new warehouse address is added to the warehouse table, I don"t need to change the code page to add a new column to show the new split inventory. But at present, this kind of query is too time-consuming and inefficient. I don"t know how to optimize or use other methods to achieve the effect I want. Talent is sparse and learning is shallow. I hope all of you who pass by will not be stingy.

Oct.14,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e61cbd-4596c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e61cbd-4596c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?