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

Use distinct() problem #28

Open
darbor opened this issue Oct 14, 2022 · 1 comment
Open

Use distinct() problem #28

darbor opened this issue Oct 14, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@darbor
Copy link

darbor commented Oct 14, 2022

I have problem with use distinct()

error in file DataTableQuery.php line 101
$value = $row->{$column->alias};

"Undefined property: stdClass::$f.firmname"

temporarily fixed it yes but i don't know if it's correct

$tmp = explode('.',$column->alias);
if(count($tmp)  == 2) {
   $column->alias = $tmp[1];
}                       
$value = $row->{$column->alias};

my query to datatable is:
$builder = $db->table('firms f') ->distinct() ->select('f.firmname, f.nip, f.pkd,f.id') ->where('f.deleted_at', NULL);

my query has several joins so I use "firms f"

@darbor darbor added the bug Something isn't working label Oct 14, 2022
@hermawanramadhan
Copy link
Owner

sorry late reply, temporary you can use column alias to solve this, will fix later on next update. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants