改名
This commit is contained in:
@@ -23,8 +23,9 @@ class InCondition extends Condition
|
|||||||
{
|
{
|
||||||
if (is_array($this->value)) {
|
if (is_array($this->value)) {
|
||||||
return sprintf('%s IN (%s)', $this->column, implode(',', $this->value));
|
return sprintf('%s IN (%s)', $this->column, implode(',', $this->value));
|
||||||
|
} else {
|
||||||
|
return sprintf('%s IN (%s)', $this->column, $this->value);
|
||||||
}
|
}
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -702,7 +702,10 @@ trait QueryTrait
|
|||||||
*/
|
*/
|
||||||
public function in($columns, $value): static
|
public function in($columns, $value): static
|
||||||
{
|
{
|
||||||
if (empty($value) || !is_array($value)) {
|
if ($value instanceof Closure) {
|
||||||
|
$value = $this->makeClosureFunction($value);
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
$value = [-1];
|
$value = [-1];
|
||||||
}
|
}
|
||||||
$this->where[] = ['IN', $columns, $value];
|
$this->where[] = ['IN', $columns, $value];
|
||||||
|
|||||||
Reference in New Issue
Block a user