DataRecycle.php 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\admin\validate;
  3. use think\Validate;
  4. class DataRecycle extends Validate
  5. {
  6. protected $failException = true;
  7. protected $rule = [
  8. 'name' => 'require',
  9. 'controller' => 'require|unique:security_data_recycle',
  10. 'data_table' => 'require',
  11. 'primary_key' => 'require',
  12. ];
  13. /**
  14. * 验证提示信息
  15. * @var array
  16. */
  17. protected $message = [];
  18. /**
  19. * 字段描述
  20. */
  21. protected $field = [
  22. ];
  23. /**
  24. * 验证场景
  25. */
  26. protected $scene = [
  27. 'add' => ['name', 'controller', 'data_table', 'primary_key'],
  28. 'edit' => ['name', 'controller', 'data_table', 'primary_key'],
  29. ];
  30. public function __construct()
  31. {
  32. $this->field = [
  33. 'name' => __('Name'),
  34. 'controller' => __('Controller'),
  35. 'data_table' => __('Data Table'),
  36. 'primary_key' => __('Primary Key'),
  37. ];
  38. parent::__construct();
  39. }
  40. }