/** * @throws \think\Exception */ protected function getDb(){ if(!$this->my_db){ $this->my_db = Db::connect(config('db2')); } }
config.php