Skip to content

0.7.4

Latest
Compare
Choose a tag to compare
@Finesse Finesse released this 15 Feb 09:20
· 1 commit to master since this release

Fixed:

  • Getting an aggregate fails when the query has derived fields (defined in the select section) in the order section. Example, reproducing the error:

    $database
        ->table('posts')
        ->addSelect($database->raw('likes_count + comments_count'), 'acknowledgement')
        ->orderBy('acknowledgement', 'desc')
        ->count();

    A more live example:

    $query = $database
        ->table('posts')
        ->addSelect($database->raw('likes_count + comments_count'), 'acknowledgement')
        ->orderBy('acknowledgement', 'desc');
    
    $paginator = new Pagerfanta(new PagerfantaAdapter($query));
    $pagesCount = $paginator->getNbPages();