ArticlesValidate.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 小夏 < 449134904@qq.com>
  10. // | Date: 2019/01/11
  11. // | Time:下午 03:24
  12. // +----------------------------------------------------------------------
  13. namespace api\portal\validate;
  14. use think\Validate;
  15. class ArticlesValidate extends Validate
  16. {
  17. protected $rule = [
  18. 'post_title' => 'require',
  19. 'post_content' => 'require',
  20. 'categories' => 'require'
  21. ];
  22. protected $message = [
  23. 'post_title.require' => '文章标题不能为空',
  24. 'post_content.require' => '内容不能为空',
  25. 'categories.require' => '文章分类不能为空'
  26. ];
  27. protected $scene = [
  28. 'article' => [ 'post_title' , 'post_content' , 'categories' ],
  29. 'page' => ['post_title']
  30. ];
  31. }