LevelCheck.php 640 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/GPL-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate;
  8. use think\Validate;
  9. class LevelCheck extends Validate
  10. {
  11. protected $rule = [
  12. 'title' => 'require|unique:user_level',
  13. 'id' => 'require',
  14. ];
  15. protected $message = [
  16. 'title.require' => '模块名称不能为空',
  17. 'title.unique' => '同样的等级名称已经存在',
  18. 'id.require' => '缺少更新条件',
  19. ];
  20. protected $scene = [
  21. 'add' => ['title'],
  22. 'edit' => ['id','title'],
  23. ];
  24. }