<?php

namespace app\admin\controller;

use app\admin\AdminBaseController;
use app\common\model\NoticeModel;
use app\admin\validate\NoticeValidate;
use app\common\model\RecruitModel;
use think\exception\ValidateException;

class Select extends AdminBaseController
{

    /**
     * 列表
     */
    public function recruit()
    {
        return view('', [
            'status_list' => RecruitModel::STATUS_INT,
        ]);
    }

    public function listRecruit()
    {
        $map   = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
        $list  = RecruitModel::where($map)
            ->order(['priority' => 'desc', 'update_time' => 'desc'])
            ->limit(input('limit'))
            ->page(input('page'))
            ->append(['status_text'])
            ->select();
        $count = RecruitModel::where($map)->count();
        if ($count == 0) {
            ajax_return(1, '未查询到数据');
        }
        list_return($list, $count);
    }
}