<?php
namespace app\admin\validate\intelligence;

use think\Validate;

class LogValidate extends Validate
{
    protected $rule =   [
        'category_name'  => 'require|max:20',
        'log_id'    => 'require',
        'category_pid'   => 'require',
    ];

    protected $message  =   [
        'category_name.require' => '分类名称不能为空',
        'log_id.require'        => '设备日志id不能为空',
        'category_name.max'     => '分类名称不能超过20字',
        'category_pid'          => '父级id不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['category_name','category_pid'],
        'update'   => ['category_id'],
        'info'     => ['log_id']
    ];
}
