nk-lihaink-cn/app/admin/validate/LevelCheck.php

30 lines
640 B
PHP
Raw Normal View History

2021-01-30 20:59:12 +08:00
<?php
2021-07-26 17:41:59 +08:00
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/GPL-2.0
2021-07-26 17:41:59 +08:00
* @link https://www.gougucms.com
*/
2021-01-30 20:59:12 +08:00
namespace app\admin\validate;
2021-07-26 17:41:59 +08:00
2021-01-30 20:59:12 +08:00
use think\Validate;
class LevelCheck extends Validate
2021-01-30 20:59:12 +08:00
{
protected $rule = [
'title' => 'require|unique:user_level',
2021-07-26 17:41:59 +08:00
'id' => 'require',
2021-01-30 20:59:12 +08:00
];
protected $message = [
'title.require' => '模块名称不能为空',
'title.unique' => '同样的等级名称已经存在',
2021-07-26 17:41:59 +08:00
'id.require' => '缺少更新条件',
2021-01-30 20:59:12 +08:00
];
protected $scene = [
'add' => ['title'],
'edit' => ['id','title'],
2021-01-30 20:59:12 +08:00
];
2021-07-26 17:41:59 +08:00
}