<?php


namespace app\admin\validate;


class ComplaintItemValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'name' => 'require|length:1,100',
        'level' => 'require|integer|min:0',
        'weight' => 'require|integer|min:0',
    ];

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'name' => '投诉项',
        'level' => '等级',
        'weight' => '权重',
    ];

    /**
     * @notes 编辑场景
     */
    public function sceneEdit()
    {
        return $this->only(['name', 'level', 'weight', 'language_code']);
    }

    public function sceneId()
    {
        return $this->only(['id']);
    }

}