Replies: 1 comment
-
FYI, You can use three backticks to format code blocks. I believe Using a single model for multiple tables goes against MVC & usage of ORM - where each model is supposed to represent a separate table. The fact that you have (at least) 6 tables holding identical information that can be accessed using the same object, seems to me like you should just combine all the tables into one Failing that, I think you're going to need to make a separate model class for each table. You could have a base abstract |
Beta Was this translation helpful? Give feedback.
-
// Controller code
// Order Model code
The query structure shows only order_5 data,How can we initialize different tables in a loop and get the data in the specified table。
Beta Was this translation helpful? Give feedback.
All reactions