$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();
[ThinkPHP5]分页与having同时使用时报错的解决方法
最新推荐文章于 2023-07-18 09:29:59 发布