'db_type' => 'mysql',
'db_user' => 'root',
'db_pwd' => '1234',
'db_host' => 'localhost',
'db_port' => '3306',
'db_name' => 'thinkphp',
'db_charset' => 'utf8',
,如何赋值给模型里的protected $connection,实现数据库切换?<?php
namespace Admin\Model;
use Think\Model;
class TestModel extends Model {
protected $connection = ??
}
?>
最佳答案
