all(); $where = []; foreach ($search_data as $k => $v) { if ($k == 'realname') { $where[] = [$k, 'like', "%$v%"]; } elseif (in_array($k,['sex','education'])) { $where[] = ['post_appoint_ic.'.$k, '=', $v]; } } $perpage = 20; $list = PostAppointIc::where($where) ->leftJoin("jobs","jobs.id",'=','post_appoint_ic.job_id') ->select('post_appoint_ic.*','jobs.jobs_name','jobs.company_name') ->orderBy('updated_at','desc') ->paginate($perpage); foreach ($list as $k => $v){ $v->native_place_cn = get_district_cn($v->native_place); $v->education = get_category($v->education); if($v->sex == 1){ $list[$k]['sex'] = '男'; }else{ $list[$k]['sex'] = '女'; } if($v->status == 0){ $list[$k]['status'] = '未下载'; }else{ $list[$k]['status'] = '已下载'; } } return $content ->header('信息管理') ->description('投递岗位人员信息列表') ->body(view('admin.ic.post_appoint_list')->with([ 'list' => $list, 'search_data' => $search_data ])); } public function postStatus(Request $request){ Permission::check('icPostInfoList'); $info = PostAppointIc::where(['id' => $request->id])->first(); if($info){ $info->status = 1; $info->save(); return response()->json(['status' => 1, 'msg' => '跳转下载中!', 'data' => 'ok', 'url' => $info->attachment]); }else{ return response()->json(['status' => 0, 'msg' => '找不到记录!', 'data' => 'fail']); } //return "/storage/recruit/word/" . $recruit->name_en . '/' .$appoint->audit .$word_url; } }