OrderOptionValidate.php 940 字节
<?php
/**
 * Created by PhpStorm.
 * User: 29925
 * Date: 2018/8/6
 * Time: 14:56
 */

namespace app\admin\validate;

use think\Validate;

class OrderOptionValidate extends Validate
{

    protected $rule = [
        'name'          => 'require',
//        'icon'          => 'require',
        'sort'          => 'require|number|between:1,12',
        'is_show'       => 'in:0,1',
    ];

    protected $message = [
        'name.require'              => '名称不能为空',
//        'icon.require'              => '图标不能为空',
        'sort.require'              => '类型不能为空',
        'sort.number'               => '类型必须为数字',
        'sort.between'              => '类型值必须在1-12之间',
        'is_show.between'           => '用户是否可见值必须在0-1之间',
    ];

//    protected $scene = [
//        'add'  => ['name', 'sort'],
//        'edit' => ['name', 'sort'],
//    ];
}