HireValidate.php 1.7 KB
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;

use think\Validate;

class HireValidate extends Validate
{
    protected $rule = [
        'select_id' => 'require',
        'title' => 'require',
        'money' => 'require',
        'start_time' => 'require',
        'end_time' => 'require',
        'address' => 'require',
        'else' => 'require',
        'people' => 'require|number|max:1000',
    ];
    protected $message = [
        'select_id.require' => '雇佣事项不为空!',
        'title.require' => '雇主名称不能为空!',
        'money.require' => '报酬总额不能为空!',
        'start_time.require' => '工作开始时间不能为空!',
        'end_time.require' => '工作结束时间不能为空!',
        'address.require' => '工作地点不能为空!',
        'else.require' => '工作要求不能为空!',
        'people.require' => '招聘人数不能为空!',
        'people.number' => '招聘人数只能为数字!',
        'people.max' => '招聘人数不得超过1000人!',

    ];

    protected $scene = [
        'adminChange' =>['title','money','start_time','end_time','address','else']
    ];

}