发布时间:2023-01-14 17:30
$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();