There are two data tables, one is alipay and the other is wxpay. The fields of the two tables are the same.
When a user queries recharge records, how can he use the model or DB class to query the two databases at the same time and get one result?
-------------------------------------------------- --------------------------
The content cannot be in pure English, and the number of words must be at least 100 words. The content cannot be in pure English. , and the content must be at least 100 words in pure English, and the content must be at least 100 words in pure English, and the content must be at least 100 words in pure English, and the content must be at least 100 words in pure English, and the content must be at least 100 words in pure English The above content cannot be pure English, and the number of words must be at least 100 words. The content cannot be pure English, and the number of words must be at least 100 words. The content cannot be pure English, and the number of words must be at least 100 words.
Just use model association
Two data tables are still two databases. If there are two data tables, just check it directly through the view. It is in the tp5 document. If there are two databases, one of them needs to use Db::connect("connection parameters")->query("query statement"), or directly use native syntax to query
If you do this with a large amount of data, the performance will be poor, just use jion to query the table
The problem is solved, just convert the query results into array format, and then merge the two arrays.
I have learned relatively little about MYSQL and have not used joint table queries.