2021-01-30 20:59:12 +08:00
|
|
|
<?php
|
2021-07-26 17:41:59 +08:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
2022-02-16 14:50:12 +08:00
|
|
|
* @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;
|
|
|
|
|
2022-02-16 14:50:12 +08:00
|
|
|
class LevelCheck extends Validate
|
2021-01-30 20:59:12 +08:00
|
|
|
{
|
|
|
|
protected $rule = [
|
2022-02-16 14:50:12 +08:00
|
|
|
'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 = [
|
2022-02-16 14:50:12 +08:00
|
|
|
'title.require' => '模块名称不能为空',
|
|
|
|
'title.unique' => '同样的等级名称已经存在',
|
2021-07-26 17:41:59 +08:00
|
|
|
'id.require' => '缺少更新条件',
|
2021-01-30 20:59:12 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
protected $scene = [
|
2021-08-31 23:40:54 +08:00
|
|
|
'add' => ['title'],
|
|
|
|
'edit' => ['id','title'],
|
2021-01-30 20:59:12 +08:00
|
|
|
];
|
2021-07-26 17:41:59 +08:00
|
|
|
}
|