Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello, i am using cakephp 3.0.3 i have following custome finder in ThreadTable,
- //ThreadTable
- public function findWithUserCount(Query $query, array $options)
- {
- return $query
- ->matching('Users')
- ->select([
- 'Threads.id',
- 'count' => 'COUNT(Users.id)'
- ])
- ->group('Threads.id HAVING count = ' . $options['count']);
- }
- and i am access this finder from my controller as bellow,
- $query = $this->Threads
- ->find('withUserCount', ['count' => 2]);
- so mysql will give me proper answer but postgressql does not parse the syntex, it give me error like "ERROR: column "count" does not exist"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement