$inforList = DB::table('表1 as a')
->leftJoin('表2 as b', function ($join) {
$join->on('a.issuetype', '=', 'b.code')->where('b.type', '=', 'issuetype');
})
->leftJoin('表3 as c','a.operator', '=', 'c.id')
//这个$where是动态条件
->where($where)
//这个where是固定条件
->where([
['a.istatus','=',1],
['a.igrade','>=',$grade_id]
])
//$whereRaw原生输入
->whereRaw("position(',$uid,' in a.uid) >0")
//$orwhere是或的关系
->orwhere('a.operator','=',$uid)
->select('a.id','a.title','b.name','a.inforunit','c.username','a.issuetime','a.browsenum')
->orderBy('a.issuetime')
//分页
->limit($pageSize)
->offset($pageIndex)
->get();