public function check(Request $request) { $id = $request->input('id'); $name = $request->input('name'); $sex = $request->input('sex'); $department = $request->input('department'); $title = $request->input('title'); //职称 $p_attribute = $request->input('p_attribute'); //人员属性 $p_category = $request->input('p_category'); //人员类别 //dd(empty($id),empty($name),empty($state)); if (empty($id) && empty($name) && empty($sex) && empty($department) && empty($title) && empty($p_attribute) && empty($p_category)) { $p = File::all(); } else { $p = new File(); if (!empty($id)) { $p = $p->where('id', '=', $id); } if (!empty($name)) { $p = $p->where('name', '=', $name); } if (!empty($sex)) { $p = $p->where('sex', '=', $sex); } if (!empty($department)) { $p = $p->where('department', '=', $department); } if (!empty($title)) { $p = $p->where('title', '=', $title); } if (!empty($p_attribute)) { $p = $p->where('p_attribute', '=', $p_attribute); } if (!empty($p_category)) { $p = $p->where('p_category', '=', $p_category); } $p = $p->get(); } return view('dream.person.file', ['persons' => $p]); }
/** * Execute the 'upgrade' console command. * @return void */ public function fire() { foreach (File::all() as $file) { $this->process($file); } }