diff --git a/ActiveQuery.php b/ActiveQuery.php index 87fc7e4..dbdcb4e 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -20,24 +20,10 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder { - /** @var bool */ - public bool $asArray = FALSE; - - /** @var bool */ - public bool $useCache = FALSE; - - /** - * @var Connection|null - */ - public ?Connection $db = NULL; - - - /** - * @var array - * 参数绑定 - */ - public array $attributes = []; - protected mixed $_mock = null; + public bool $asArray = FALSE; + public ?Connection $db = NULL; + public array $attributes = []; + protected mixed $_mock = null; /** diff --git a/Query.php b/Query.php index 7346a47..d991528 100644 --- a/Query.php +++ b/Query.php @@ -19,13 +19,6 @@ use Database\Traits\QueryTrait; class Query extends QueryTrait implements ISqlBuilder { - - /** - * @var SqlBuilder - */ - protected SqlBuilder $builder; - - /** * @throws */ diff --git a/Traits/QueryTrait.php b/Traits/QueryTrait.php index c1ced93..68bba64 100644 --- a/Traits/QueryTrait.php +++ b/Traits/QueryTrait.php @@ -16,6 +16,7 @@ use Database\Base\ActiveQueryInterface; use Database\ISqlBuilder; use Database\ModelInterface; use Database\Query; +use Database\SqlBuilder; use Exception; use Kiri; use Kiri\Abstracts\Component; @@ -26,17 +27,18 @@ use Kiri\Abstracts\Component; */ class QueryTrait extends Component implements ActiveQueryInterface, ISqlBuilder { - protected array $where = []; - protected array $select = []; - protected array $join = []; - protected array $order = []; - protected int $offset = 0; - protected int $limit = 0; - protected string $group = ''; - protected string $from = ''; - protected string $alias = 't1'; - protected array $filter = []; - protected bool $lock = false; + protected array $where = []; + protected array $select = []; + protected array $join = []; + protected array $order = []; + protected int $offset = 0; + protected int $limit = 0; + protected string $group = ''; + protected string $from = ''; + protected string $alias = 't1'; + protected array $filter = []; + protected bool $lock = false; + protected SqlBuilder $builder; /**