|
|
<?php
|
|
|
// +----------------------------------------------------------------------
|
|
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
|
|
// +----------------------------------------------------------------------
|
|
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
|
|
// | 开源版本可自由商用,可去除界面版权logo
|
|
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
|
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
|
|
// | 访问官网:https://www.likeadmin.cn
|
|
|
// | likeadmin团队 版权所有 拥有最终解释权
|
|
|
// +----------------------------------------------------------------------
|
|
|
// | author: likeadminTeam
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
|
namespace app\adminapi\validate\business;
|
|
|
|
|
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Mail验证器
|
|
|
* Class MailValidate
|
|
|
* @package app\adminapi\validate\business
|
|
|
*/
|
|
|
class MailValidate extends BaseValidate
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 设置校验规则
|
|
|
* @var string[]
|
|
|
*/
|
|
|
protected $rule = [
|
|
|
'id' => 'require',
|
|
|
'cid' => 'require',
|
|
|
'title' => 'require|max:100',
|
|
|
'content' => 'require',
|
|
|
// 'regTime' => 'require',
|
|
|
];
|
|
|
|
|
|
protected $message = [
|
|
|
'id.require' => '参数缺失',
|
|
|
'cid.require' => '请输入区服ID',
|
|
|
'title.length' => '标题长度不超过100个字符',
|
|
|
'content.require' => '请输入邮件内容',
|
|
|
// 'regTime.require' => '选择领取的账号注册时间',
|
|
|
];
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 参数描述
|
|
|
* @var string[]
|
|
|
*/
|
|
|
protected $field = [
|
|
|
'id' => 'id',
|
|
|
'cid' => '区服ID',
|
|
|
'title' => '邮件标题',
|
|
|
'content' => '邮件内容',
|
|
|
'at' => '创建时间',
|
|
|
'rewards' => '奖励',
|
|
|
'regTime' => '领取注册时间',
|
|
|
];
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @notes 添加场景
|
|
|
* @return MailValidate
|
|
|
* @author likeadmin
|
|
|
* @date 2024/03/12 11:18
|
|
|
*/
|
|
|
public function sceneAdd()
|
|
|
{
|
|
|
return $this->only(['cid', 'title', 'type', 'content', 'at', 'rewards', 'regTime']);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @notes 编辑场景
|
|
|
* @return MailValidate
|
|
|
* @author likeadmin
|
|
|
* @date 2024/03/12 11:18
|
|
|
*/
|
|
|
public function sceneEdit()
|
|
|
{
|
|
|
return $this->only(['id', 'cid', 'title', 'type', 'content', 'at', 'rewards', 'regTime']);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @notes 删除场景
|
|
|
* @return MailValidate
|
|
|
* @author likeadmin
|
|
|
* @date 2024/03/12 11:18
|
|
|
*/
|
|
|
public function sceneDelete()
|
|
|
{
|
|
|
return $this->only(['id']);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @notes 详情场景
|
|
|
* @return MailValidate
|
|
|
* @author likeadmin
|
|
|
* @date 2024/03/12 11:18
|
|
|
*/
|
|
|
public function sceneDetail()
|
|
|
{
|
|
|
return $this->only(['id']);
|
|
|
}
|
|
|
}
|