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
Menu