first commit
This commit is contained in:
40
pgserver/application/common/validate/NoticeValidate.php
Normal file
40
pgserver/application/common/validate/NoticeValidate.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class NoticeValidate extends Validate
|
||||
{
|
||||
/**
|
||||
* 定义验证规则
|
||||
* 格式:'字段名' => ['规则1','规则2'...]
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $rule = [
|
||||
'title' => 'require|max:50',
|
||||
'relevant_personnel' => 'require',
|
||||
'relevant_personnel_ids' => 'require',
|
||||
'content' => 'require',
|
||||
];
|
||||
|
||||
/**
|
||||
* 定义错误信息
|
||||
* 格式:'字段名.规则名' => '错误信息'
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $message = [
|
||||
'title.require' => '标题不能为空',
|
||||
'title.max' => '标题最多允许50字',
|
||||
'relevant_personnel.require' => '相关人员不能为空',
|
||||
'relevant_personnel_ids.require' => '相关人员ids不能为空',
|
||||
'content.require' => '内容不能为空',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'notice_edit' => ['title','content'],
|
||||
'circulation_edit' => ['title','relevant_personnel','relevant_personnel_ids','content'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user