$data = TeacherField::where($where)->where(
function($query)use($user){ // use($user) 传递变量 否则会报错
$query->where('school_id',$user->school_id)
->orWhere('is_public',1);
}
)->get(['id','field_name as name']);