public __construct ( |
||
$connection | 数据库对象实例 | |
$model | string | 模型名 |
public function __construct(Connection $connection = null, $model = '')
{
$this->connection = $connection ?: Db::connect([], true);
$this->builder = $this->connection->getConfig('builder') ?: $this->connection->getConfig('type');
$this->prefix = $this->connection->getConfig('prefix');
$this->model = $model;
}