[ThinkPHP5]分页与having同时使用时报错的解决方法

        $buildSql = db('project')
                    ->alias('a')
                    ->join('user_project b','b.pid = a.id and b.uid = 1','LEFT')
                    ->field('a.id,a.title,b.id as uid')
                    ->order('a.id desc')
                    ->group('a.id')
                    ->having('uid is null')
                    ->buildSql();

        $page = input('page')??1;
        $pageSize = input('limit')??10;

        $list = Db::table($buildSql)
                ->alias('a')
                ->order('a.id desc')
                ->paginate(array('list_rows'=>$pageSize,'page'=>$page))
                ->toArray();

你可能感兴趣的:(ThinkPHP,php,thinkphp)