Scandal
Well-known member
I have this issue during the use of XF2 Finder.
Here is an example use of the Finder inside a controller:
-> the myfield != '' is a column on xf_user table. All ok with it! And I don't have to use XF:Ban finder as initial finder but to use with() to make the JOIN.
-> the order by register_date works fine cause it is a column on xf_user table.
-> The issue: I want to order by ban_date which is a column on xf_user_ban table but I'm receiving error Unknown column ban_date on XF:User
Is there a way to order by a LEFT JOIN's table column?
Here is an example use of the Finder inside a controller:
PHP:
$this->finder('XF:User')->with('Ban', false)->whereOr(['secondary_group_ids', '=', $bannedusergroupid],
['user_group_id', '=', $bannedusergroupid])->where('myfield', '!=', '')->order('register_date', 'DESC')->limitByPage($page, $perpage)->fetch();
-> the myfield != '' is a column on xf_user table. All ok with it! And I don't have to use XF:Ban finder as initial finder but to use with() to make the JOIN.
-> the order by register_date works fine cause it is a column on xf_user table.
-> The issue: I want to order by ban_date which is a column on xf_user_ban table but I'm receiving error Unknown column ban_date on XF:User
Is there a way to order by a LEFT JOIN's table column?