RuleCheck.php 765 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate;
  8. use think\Validate;
  9. class RuleCheck extends Validate
  10. {
  11. protected $rule = [
  12. 'title' => 'require',
  13. 'src' => 'unique:admin_rule',
  14. 'id' => 'require',
  15. ];
  16. protected $message = [
  17. 'title.require' => '节点名称不能为空',
  18. 'src.unique' => '同样的节点URL已经存在',
  19. 'id.require' => '缺少更新条件',
  20. 'filed.require' => '缺少要更新的字段名',
  21. ];
  22. protected $scene = [
  23. 'add' => ['title','src'],
  24. 'edit_title' => ['id', 'title'],
  25. 'edit_src' => ['id', 'src'],
  26. ];
  27. }