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