ComplaintValidate.php 700 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\admin\validate;
  3. class ComplaintValidate extends BaseValidate
  4. {
  5. /**
  6. * 设置校验规则
  7. * @var string[]
  8. */
  9. protected $rule = [
  10. 'id' => 'require',
  11. 'name' => 'require|min:1',
  12. 'weight' => 'require|integer|min:0',
  13. ];
  14. /**
  15. * 参数描述
  16. * @var string[]
  17. */
  18. protected $field = [
  19. 'id' => 'id',
  20. 'name' => '投诉项',
  21. 'weight' => '权重',
  22. ];
  23. /**
  24. * @notes 编辑场景
  25. */
  26. public function sceneEdit()
  27. {
  28. return $this->only(['name', 'weight', 'language_code']);
  29. }
  30. public function sceneId()
  31. {
  32. return $this->only(['id']);
  33. }
  34. }