123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App\Admin\Controllers\Ic;
- use App\Http\Controllers\Controller;
- use App\Models\PostAppointIc;
- use Encore\Admin\Auth\Permission;
- use Encore\Admin\Layout\Content;
- use Illuminate\Http\Request;
- class IndexController extends Controller
- {
- public function postInfoList(Content $content, Request $request){
- Permission::check('icPostInfoList');
- $search_data = $request->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;
- }
- }
|