nk-lihaink-cn/app/admin/validate/ArticleCateCheck.php
2021-01-30 20:59:12 +08:00

26 lines
745 B
PHP

<?php
namespace app\admin\validate;
use think\Validate;
class ArticleCateCheck extends Validate
{
protected $rule = [
'title' => 'require|unique:article_cate',
'pid' => 'require',
'id' => 'require',
'field' => 'require',
];
protected $message = [
'title.require' => '名称不能为空',
'pid.require' => '父级分类为必选',
'title.unique' => '同样的记录已经存在',
'id.require' => '缺少更新条件',
'filed.require' => '缺少要更新的字段名',
];
protected $scene = [
'add' => ['title', 'pid'],
'edit' => ['id', 'field','title.unique'],
];
}