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

21 lines
549 B
PHP

<?php
namespace app\admin\validate;
use think\Validate;
class SitemapCateCheck extends Validate
{
protected $rule = [
'name' => 'require|unique:sitemap_cate',
'id' => 'require',
];
protected $message = [
'name.require' => '名称不能为空',
'name.unique' => '同样的记录已经存在!',
'id.require' => '缺少更新条件',
];
protected $scene = [
'add' => ['name'],
'edit' => ['id', 'name'],
];
}