12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\admin\validate\notice;
- use think\Validate;
- class SubjectValidate extends Validate
- {
- protected $rule = [
- 'notice_id' => 'require',
- 'notice_title' => 'require',
- 'notice_introduce' => 'require',
- 'notic_content' => 'require',
- ];
- protected $message = [
- 'notice_id.require' => '公告ID不能为空',
- 'notice_title.require' => '公告标题不能为空',
- 'notice_introduce.require' => '公告简介不能为空',
- 'notic_content.require' => '公告内容不能为空',
- ];
- //场景
- protected $scene = [
- 'add' => ['notice_introduce','notice_title','notic_content'],
- 'info' => ['notice_id'],
- 'update' => ['notice_id']
- ];
- }
|