// +---------------------------------------------------------------------- declare (strict_types = 1); namespace addon\haonav\validate; use think\Validate; /** * Category 类 * * @author ywxapp */ class Category extends Validate { protected $rule = [ 'title' => 'require|chsDash|max:50', 'pid' => 'integer|egt:0', 'icon' => 'max:50', 'summary'=> 'max:255', 'sort' => 'integer', 'status' => 'in:0,1', ]; protected $message = [ 'title.require' => '分类名称不能为空', 'title.chsDash' => '分类名称只能是汉字、字母、数字或破折号', 'title.max' => '分类名称不能超过 50 个字符', 'pid.integer' => '上级分类必须是数字', 'pid.egt' => '上级分类不能为负', 'icon.max' => '图标标识过长', 'summary.max' => '简介不能超过 255 个字符', 'sort.integer' => '排序必须是数字', 'status.in' => '状态值不合法', ]; }