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

use App\Http\Requests\BaseRequest;

/**
 * 账号权限管理
 *
 * */
class AuthGroupAccess extends BaseRequest{

    /**
     *
     * @return  array
     */
    public  function  rules(){
        // 编辑时排除ID 
        $id			           = request('id',0);
        // 规则
        return [
            'admin_uid'        => 'required|integer|gt:0',
            'group_id'         => 'required|integer|gt:0',
        ];
    }

    // 场景列表
    protected   $scenes         = [
		'list'  		        => ['admin_uid'],
        'set_group'  		    => ['admin_uid','group_id'],
        'set_access'  		    => ['admin_uid'],
	];

    /**
     *
     * @return  array
     */
    public  function  messages()    {
        return [
            'admin_uid.required'    => '账号ID不能为空',
            'admin_uid.integer'     => '账号ID格式错误',
            'admin_uid.gt'   		=> '账号ID格式错误',
            'group_id.required'     => '请选择权限组',
            'group_id.integer'   	=> '权限组ID格式错误',
            'group_id.gt'   		=> '权限组ID格式错误',
        ];
    }

}
