Like the title, I would like to ask you about cross-database join table query in TP5.1 ms sql server:
The current situation is as follows, I have a statistical report system project at hand,
My back-end is made with tp5.1, and the front-end is made with vue. The user information of the system front-end is written in the mysql library, that is, different users can see different statistical report information after logging in.
The information that needs to be counted and generated is a different database and a different table on the MS Sql Server of another windows server. I have already done it. The configuration of multiple databases. The configuration of each database The connection and query have been implemented and there is no problem, but now I encounter problems when I need to query cross-database join tables.
This is how I look up tables now, for example, I want to check ms sql When using the database, first Db:: connect('mysql database') filters the login account information, and then connects to another database (ms sql) through a loop Db:: connect('mssql consumer db1') select(), and then Connect another library Db:connect('mssql recharge library db2') to query through a loop, and then perform statistics and other operations after summarizing. Now it takes a long time to query the data, which is quite troublesome. When displayed on the front end, it will feel awkward. Stuck, not smooth. Is there any implementation method that can quickly implement cross-database and join table queries. I hope teachers and seniors can give some ideas. I would like to thank you all in advance.
I have also made models for several commonly used libraries. But as a novice, I still don’t know how to do it.
I don’t know if you will understand what I write like this. If you don’t understand, I will explain later. To add more. I hope I can get help from everyone. Thank you again@!!@
Hello. Does anyone know how to do it?
Here’s a thumbs up.