CurrencyValidate.php 716 B

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