一、代码
/**
* @throws \think\Exception
*/
protected function getDb(){
if(!$this->my_db){
$this->my_db = Db::connect(config('db2'));
}
}
config.php
微信扫一扫
/**
* @throws \think\Exception
*/
protected function getDb(){
if(!$this->my_db){
$this->my_db = Db::connect(config('db2'));
}
}
config.php
相关推荐