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

aliases losts in order by #2075

Closed
eriksape opened this issue May 2, 2019 · 1 comment
Closed

aliases losts in order by #2075

eriksape opened this issue May 2, 2019 · 1 comment

Comments

@eriksape
Copy link

eriksape commented May 2, 2019

Summary of problem or feature request

Problem with aliases in query on the order.

Code snippet of problem

public function datatable(Request $request)
{
    $report = ReportCourseUser::with(['user']);
    return DataTables::eloquent($report)->toJson();
}

I notice when i sort a column the query is the next

SELECT * 
FROM   "report_course_users" 
       LEFT JOIN "users" AS "users_0" 
              ON "report_course_users"."user_id" = "users_0"."id" 
WHERE  "users"."deleted_at" IS NULL 
       AND "report_course_users"."deleted_at" IS NULL 
ORDER  BY "users_0"."username" ASC 
LIMIT  10 offset 0 

in the line WHERE "users"."deleted_at" IS NULL users lost the alias 🤔

System details

  • Operating System: debian
  • PHP Version: 7.2.16
  • Laravel Version: 5.8
  • Laravel-Datatables Version: 9
@yajra
Copy link
Owner

yajra commented May 3, 2019

You need to update to the latest version where #2051 was reverted. Self join is not yet supported.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants