Storesnshome.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class Storesnshome extends Validate
  15. {
  16. protected $rule = [
  17. 'commentcontent' => 'require|length:0,140',
  18. 'forwardcontent' => 'require|length:0,140',
  19. ];
  20. protected $message = [
  21. 'commentcontent.require' => '需要评论点内容|不能超过140字',
  22. 'commentcontent.length' => '需要评论点内容|不能超过140字',
  23. 'forwardcontent.require' => '需要评论点内容|不能超过140字',
  24. 'forwardcontent.length' => '需要评论点内容|不能超过140字',
  25. ];
  26. protected $scene = [
  27. 'addcomment' => ['commentcontent'],
  28. 'addforward' => ['forwardcontent'],
  29. ];
  30. }