This commit is contained in:
2021-08-09 18:56:09 +08:00
parent 415abed013
commit 0377550b6f
3 changed files with 14 additions and 4 deletions
-2
View File
@@ -43,8 +43,6 @@ class ActiveQuery extends Component implements ISqlBuilder
public array $attributes = [];
private SqlBuilder $builder;
/**
* Comply constructor.
+11 -2
View File
@@ -22,13 +22,22 @@ class Query implements ISqlBuilder
use QueryTrait;
/**
* @throws Exception
*/
public function __construct()
{
$this->builder = SqlBuilder::builder($this);
}
/**
* @return string
* @throws Exception
*/
public function getSql(): string
{
return SqlBuilder::builder($this)->get();
return $this->builder->get();
}
@@ -38,7 +47,7 @@ class Query implements ISqlBuilder
*/
public function getCondition(): string
{
return SqlBuilder::builder($this)->getCondition();
return $this->builder->getCondition();
}
+3
View File
@@ -40,6 +40,9 @@ trait QueryTrait
public bool $ifNotWhere = false;
private SqlBuilder $builder;
/**
* @var ActiveRecord|string|null
*/