CompanyComment.php 697 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class CompanyComment extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. 'id' => 'require|number',
  9. 'info' => 'max:255',
  10. 'images' => 'max:500',
  11. ];
  12. // 验证提示
  13. protected $message = [
  14. 'id.require' => '请输入门店印象ID',
  15. 'id.number' => '您输入的门店印象ID,必须是数字类型',
  16. 'info.max' => '您输入的内容,必须小于255字符',
  17. 'images.max' => '您输入的图片,必须小于500字符',
  18. ];
  19. // 应用场景
  20. protected $scene = [
  21. 'add' => ['info','images'],
  22. 'edit' => ['id','info','images'],
  23. ];
  24. }