/** * 创建模型 * @param string 要使用的数据库配置 * @return void */ public function __construct($key = 'mysql') { // 读取配置 $driver = \Core\C::G($key); // 创建数据库 $this->db = Mysql::instance($driver); }