WechatReplyValidate.php 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020-04-24
  7. *
  8. *
  9. */
  10. namespace app\validate\admin;
  11. use think\Validate;
  12. /**
  13. * Class WechatReplyValidate
  14. * @package app\validate\admin
  15. * @author xaboy
  16. * @day 2020-04-27
  17. */
  18. class WechatReplyValidate extends Validate
  19. {
  20. /**
  21. * @var bool
  22. */
  23. protected $failException = true;
  24. /**
  25. * @var array
  26. */
  27. protected $rule = [
  28. 'type|类型' => 'require|in:text,image,news,voice',
  29. 'key|关键字' => 'require|max:32',
  30. 'data|回复内容' => 'require|array',
  31. 'status|开启状态' => 'require|in:0,1'
  32. ];
  33. /**
  34. * @return $this
  35. * @author xaboy
  36. * @day 2020-04-27
  37. */
  38. public function isUpdate()
  39. {
  40. unset($this->rule['key|关键字']);
  41. return $this;
  42. }
  43. }