Commit fc523fe
authored
Fixed the search column for same table relations
I have a `customers` table which is related to `customers` via `parentCustomer`.
When I try to search it uses the following expression as the column name:
```sql
LOWER(`customers` as `laravel_reserved_0`.`name`)
```
which clearly doesn't make sense since the table alias should only be added to the `FROM table_name` section of the query.
My code above checks if our "searchable column name with table prefix" has an ` as ` inside and only gets the `table_alias.searchable_column` from it.1 parent f33ef21 commit fc523fe
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
425 | 427 | | |
426 | | - | |
427 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
428 | 434 | | |
429 | 435 | | |
430 | 436 | | |
| |||
0 commit comments