News.php 821 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 新闻头条
  7. */
  8. namespace app\allwin\validate;
  9. use think\Validate;
  10. class News extends Validate{
  11. protected $rule = [
  12. 'types' => 'require|number',
  13. 'cate_id' => 'require',
  14. 'title' => 'require',
  15. 'content' => 'require',
  16. ];
  17. protected $message = [
  18. 'cate_id' => '栏目必须选择',
  19. 'types' => '必须选择内容类型',
  20. 'title' => '标题必须选择',
  21. 'content' => '内容必须输入',
  22. ];
  23. protected $scene = [
  24. 'save' => ['cate_id','types','title','content'],
  25. 'article' => ['types','title','content'],
  26. ];
  27. }