Multiple database connections and Yii 2.0

后端 未结 4 2151
遥遥无期
遥遥无期 2020-11-27 14:50

I have two databases, and every database has the same table with the same fields, but how do I get all records from all of two databases at the same time in Yii 2.0?

4条回答
  •  遥遥无期
    2020-11-27 15:08

    If you're using schmunk42/yii2-giiant to generate model classes, there is a 'modelDb' property which you can set to use a database component other than 'db'.

提交回复
热议问题