init commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\message;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 消息通知验证器
|
||||
*/
|
||||
class MessageNotification extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
'member_id' => 'require',
|
||||
'type' => 'require|in:1,2,3',
|
||||
'title' => 'require|max:255',
|
||||
'content' => 'require',
|
||||
];
|
||||
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
'member_id.require' => '会员ID不能为空',
|
||||
'type.require' => '消息类型不能为空',
|
||||
'type.in' => '消息类型必须为:1=活动通知,2=审核通知,3=系统通知',
|
||||
'title.require' => '消息标题不能为空',
|
||||
'title.max' => '消息标题最多不能超过255个字符',
|
||||
'content.require' => '消息内容不能为空',
|
||||
];
|
||||
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => ['member_id', 'type', 'title', 'content'],
|
||||
'edit' => ['type', 'title', 'content'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user