post('hospital'); if (Login::$info->hospital != 0) { if ($hospital != Login::$info->hospital) { Yo::error_echo(100000, ['机构/医院']); } } $start_time = $request->post('start_time'); $end_time = $request->post('end_time'); $time = $request->post('time'); $status = $request->post('status'); $list = ProfitsharingLog::select('*') ->where('hospital', $hospital) ->where(function ($query) use ($status) { if ($status != 0) $query->where('status', $status); }); if (!!$start_time) { $list->where('created_at', '>=', $start_time); } if (!!$end_time) { $list->where('created_at', '<=', $end_time); } return Yo::echo($list->orderBy('id', 'desc')->paginate(10)); } }