其余文件
This commit is contained in:
30
app/admin/validate/content/ArticleCategoryValidate.php
Normal file
30
app/admin/validate/content/ArticleCategoryValidate.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\validate\content;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class ArticleCategoryValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'name' => 'require',
|
||||
'is_show' => 'require|in:0,1'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'id.number' => 'id必须为数字',
|
||||
'name.require' => '请填写分类名称',
|
||||
'is_show.require' => '请选择是否显示',
|
||||
'is_show.in' => '选择是否显示异常'
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'add' => ['name', 'is_show'],
|
||||
'edit' => ['id', 'name', 'is_show']
|
||||
];
|
||||
}
|
||||
30
app/admin/validate/content/ArticleValidate.php
Normal file
30
app/admin/validate/content/ArticleValidate.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\validate\content;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class ArticleValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'cid' => 'require|number',
|
||||
'title' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'id.number' => 'id必须为数字',
|
||||
'cid.require' => '请选择分类',
|
||||
'cid.number' => '分类选择异常',
|
||||
'title.require' => '请填写文章标题'
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'add' => ['cid', 'title'],
|
||||
'edit' => ['id', 'cid', 'title'],
|
||||
];
|
||||
}
|
||||
30
app/admin/validate/content/HelpCategoryValidate.php
Normal file
30
app/admin/validate/content/HelpCategoryValidate.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\validate\content;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class HelpCategoryValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'name' => 'require',
|
||||
'is_show' => 'require|in:0,1'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'id.number' => 'id必须为数字',
|
||||
'name.require' => '请填写分类名称',
|
||||
'is_show.require' => '请选择是否显示',
|
||||
'is_show.in' => '选择是否显示异常'
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'add' => ['name', 'is_show'],
|
||||
'edit' => ['id', 'name', 'is_show']
|
||||
];
|
||||
}
|
||||
30
app/admin/validate/content/HelpValidate.php
Normal file
30
app/admin/validate/content/HelpValidate.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\validate\content;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class HelpValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'cid' => 'require|number',
|
||||
'title' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'id.number' => 'id必须为数字',
|
||||
'cid.require' => '请选择分类',
|
||||
'cid.number' => '分类选择异常',
|
||||
'title.require' => '请填写帮助标题'
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'add' => ['cid', 'title'],
|
||||
'edit' => ['id', 'cid', 'title'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user