Open tony-was opened 9 years ago
Try to use Eloquent in a simpler way?
->leftJoin('blocked_users', 'blocked_users.blocked_user_id','=',$user_id)
And I don't think it is a problem of bllim/laravel4-datatables-package. I would suggest you check Laravel documentation for more details.
@CarterZhou If I run that it gives me an "Unknown Column" error as the last attribute needs to be a column name and not an actual value.
Though I think you are right I will need to re factor this to make it a little cleaner
Try it:
'options' => [
\PDO::ATTR_EMULATE_PREPARES => true
]
Put it on your database config if you are using mysql
I ahve the following code snippet:
->leftJoin('blocked_users', function($join) use ($user_id, $id) { $join->on('users.id', '=', 'blocked_users.blocked_user_id') ->where('blocked_users.user_id', '=', $user_id); })
which throws the errors
SQLSTATE[HY000]: General error: 2031 (SQL: select count(*) as aggregate from...
not sure if anyone else is experiencing this.