chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace app\backend\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Notice extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'title' => 'require|max:200',
|
||||
'content' => 'require',
|
||||
'author' => 'max:50',
|
||||
'type' => 'in:1,2,3,4',
|
||||
'is_top' => 'in:0,1',
|
||||
'start_time' => 'integer',
|
||||
'end_time' => 'integer',
|
||||
'sort' => 'number',
|
||||
'status' => 'in:0,1',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '请输入公告标题',
|
||||
'content.require' => '请输入公告内容',
|
||||
'type.in' => '公告类型不正确',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title', 'content', 'author', 'type', 'is_top', 'start_time', 'end_time', 'sort', 'status'],
|
||||
'edit' => ['title', 'content', 'author', 'type', 'is_top', 'start_time', 'end_time', 'sort', 'status'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user