diff --git a/src/DataSources/DibiFluent.php b/src/DataSources/DibiFluent.php index f0910f52..cc0f5c27 100644 --- a/src/DataSources/DibiFluent.php +++ b/src/DataSources/DibiFluent.php @@ -162,7 +162,7 @@ public function suggest($column, array $conditions, $limit) { $fluent = clone $this->fluent; if (is_string($column)) { - $fluent->removeClause('SELECT')->select("DISTINCT %n", $column)->orderBy("%n", $column, 'ASC'); + $fluent->removeClause('SELECT')->select("DISTINCT %n AS v", $column)->orderBy("%n", $column, 'ASC'); } foreach ($conditions as $condition) { @@ -173,7 +173,7 @@ public function suggest($column, array $conditions, $limit) $data = $fluent->fetchAll(0, $limit); foreach ($data as $row) { if (is_string($column)) { - $value = (string) $row[$column]; + $value = (string) $row['v']; } elseif (is_callable($column)) { $value = (string) $column($row); } else {