2023-10-24 15:17:16 +08:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
|
|
|
* @license https://opensource.org/licenses/GPL-3.0
|
|
|
|
* @link https://www.gougucms.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace app\user\validate;
|
|
|
|
|
|
|
|
use think\Validate;
|
|
|
|
|
|
|
|
class PositionCheck extends Validate
|
|
|
|
{
|
|
|
|
protected $rule = [
|
|
|
|
'title' => 'require|unique:position',
|
|
|
|
'group_id' => 'require',
|
|
|
|
'id' => 'require'
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $message = [
|
|
|
|
'title.require' => '岗位名称不能为空',
|
|
|
|
'title.unique' => '同样的岗位名称已经存在',
|
|
|
|
'group_id.require' => '至少要选择一个角色权限',
|
|
|
|
'id.require' => '缺少更新条件',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $scene = [
|
2023-11-18 14:22:17 +08:00
|
|
|
'add' => ['title', 'group_id'],
|
|
|
|
'edit' => ['title', 'group_id', 'id'],
|
2023-10-24 15:17:16 +08:00
|
|
|
];
|
|
|
|
}
|