<?php  namespace  App\Http\Requests\Manager;

use App\Http\Requests\BaseRequest;

/**
 * 管理后台平台类目
 * @author  jun
 *
 * */
class CompanyCategory extends BaseRequest{

    /**
     *
     * @return  array
     */
    public  function  rules(){
        return [
            'id'                =>  'required|integer|gt:0',
            'name'              =>  'required|unique:company_category,name,'.request('id',0),
        ];
    }

    // 场景列表
    protected   $scenes         = [
        'add'  		            => ['name'],
        'edit'  		        => ['id','name'],
        'set_status'  		    => ['id'],
    ];
    /**
     *
     * @return  array
     */
    public  function  messages(){
        return [
            'name.required'     => '类型名称必填',
            'name.unique'	    => '类型名称已经存在',
            'id.required'       => 'ID未知',
            'id.integer'        => 'ID格式错误',
            'id.gt'   		    => 'ID格式错误',
        ];
    }

}
