This commit is contained in:
2021-03-26 19:09:54 +08:00
parent 11ef881927
commit 78cf1b2a9a
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -702,7 +702,10 @@ trait QueryTrait
*/
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];
}
$this->where[] = ['IN', $columns, $value];