NoticeValidate.php 861 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\admin\validate\notice;
  3. use think\Validate;
  4. class SubjectValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'notice_id' => 'require',
  8. 'notice_title' => 'require',
  9. 'notice_introduce' => 'require',
  10. 'notic_content' => 'require',
  11. ];
  12. protected $message = [
  13. 'notice_id.require' => '公告ID不能为空',
  14. 'notice_title.require' => '公告标题不能为空',
  15. 'notice_introduce.require' => '公告简介不能为空',
  16. 'notic_content.require' => '公告内容不能为空',
  17. ];
  18. //场景
  19. protected $scene = [
  20. 'add' => ['notice_introduce','notice_title','notic_content'],
  21. 'info' => ['notice_id'],
  22. 'update' => ['notice_id']
  23. ];
  24. }