public __construct ( Swoole $swoole, string $db_key = 'master' ) | ||
$swoole | Swoole | |
$db_key | string | 选择哪个数据库 |
function __construct(\Swoole $swoole, $db_key = 'master')
{
$this->db = $swoole->db($db_key);
$this->dbs = new SelectDB($this->db);
$this->swoole = $swoole;
}