diff --git a/Traits/QueryTrait.php b/Traits/QueryTrait.php index 071c6cb..c186943 100644 --- a/Traits/QueryTrait.php +++ b/Traits/QueryTrait.php @@ -1068,7 +1068,11 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq private function sprintf(string $column, mixed $value, string $opera = '='): string { if (!is_numeric($value)) { - [$alias, $field] = explode('.', $value); + if (str_contains($column, '.')) { + [$alias, $field] = explode('.', $value); + } else { + $alias = ''; + } if (in_array($alias, $this->_alias)) { return $column . ' ' . $opera . ' ' . $value; }