SpeechcraftValidate.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\kefu;
  12. use think\Validate;
  13. class SpeechcraftValidate extends Validate
  14. {
  15. /**
  16. * @var string[]
  17. */
  18. protected $rule = [
  19. 'title' => 'chsAlphaNum|length:0,50',
  20. 'message' => 'require|length:0,500',
  21. 'sort' => 'number',
  22. ];
  23. /**
  24. * @var string[]
  25. */
  26. protected $message = [
  27. 'title.chsAlphaNum' => '请填汉字字母或者数字',
  28. 'title.length' => '标题长度不能超过50个字',
  29. 'cate_id.require' => '请选择分类',
  30. 'cate_id.number' => '分类必须为数字',
  31. 'message.require' => '请填写话术内容',
  32. 'message.length' => '话术长度不能超过500个字',
  33. 'sort.number' => '排序必须为数字',
  34. ];
  35. }