ChannelValidate.php 682 字节
<?php
/**
 * Created by PhpStorm.
 * User: 29925
 * Date: 2018/8/12
 * Time: 9:33
 */

namespace app\admin\validate;

use think\Validate;

class ChannelValidate extends Validate
{

    protected $rule = [
        'name'       => 'require|unique:channel,name',
        'is_stop'        => 'require|in:0,1',
    ];

    protected $message = [
        'name.require'      => '渠道名称不能为空',
        'name.unique'       => '渠道名称已存在',
        'is_stop.require'   => '收集状态不能为空',
        'is_stop.in'        => '收集状态数值错误',
    ];

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