nk-lihaink-cn/app/admin/validate/SitemapCateCheck.php
2021-07-26 17:41:59 +08:00

30 lines
633 B
PHP

<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.gougucms.com
*/
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'],
];
}