Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k_k_people.NameHindi' in 'group statement' #201

Open
sandeeprawat88 opened this issue Sep 13, 2019 · 0 comments

Comments

@sandeeprawat88
Copy link

This issue came when this library creating multiple group by and if db has $prefix then it append two times because getColumns() calls twice in SearchableTrait
First in scopeSearchRestricted() function and secondly in makeGroupBy() functions

I found a solution that we need to replace code from line 209 to 2016 with below code
$prefix = Config::get("database.connections.$driver.prefix"); foreach ($this->getColumns() as $column => $relevance) { array_map(function ($join) use ($column, $query, $prefix) { if (Str::contains($column, $join)) { $column = str_replace($prefix, "", $column); $query->groupBy($column); } }, $joins); }

This resolves the issue. @nicolaslopezj can you please make these changes to the library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant