改名
This commit is contained in:
+11
-1
@@ -44,6 +44,17 @@ class SqlBuilder extends Component
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $compiler
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public function hashCompiler(array $compiler): string
|
||||
{
|
||||
return $this->where($compiler);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @return bool|array
|
||||
@@ -97,7 +108,6 @@ class SqlBuilder extends Component
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
* @param false $isBatch
|
||||
|
||||
@@ -816,12 +816,16 @@ trait QueryTrait
|
||||
* @return $this
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function where(Closure|array $conditions): static
|
||||
{
|
||||
if ($conditions instanceof Closure) {
|
||||
$conditions = $this->makeClosureFunction($conditions);
|
||||
}
|
||||
if (is_array($conditions)) {
|
||||
$conditions = $this->builder->hashCompiler($conditions);
|
||||
}
|
||||
$this->where[] = $conditions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user