27 lines
910 B
PHP
27 lines
910 B
PHP
<?php
|
|
namespace app\admin\validate;
|
|
use think\Validate;
|
|
|
|
class ArticleCheck extends Validate
|
|
{
|
|
protected $rule = [
|
|
'title' => 'require|unique:article',
|
|
'content' => 'require',
|
|
'id' => 'require',
|
|
'article_cate_id' => 'require',
|
|
'status' => 'require'
|
|
];
|
|
|
|
protected $message = [
|
|
'title.require' => '标题不能为空',
|
|
'article_cate_id.require' => '所属分类为必选',
|
|
'title.unique' => '同样的记录已经存在!',
|
|
'id.require' => '缺少更新条件',
|
|
'status.require' => '状态为必选',
|
|
];
|
|
|
|
protected $scene = [
|
|
'add' => ['title', 'thumb', 'article_cate_id', 'content', 'status'],
|
|
'edit' => ['title', 'thumb', 'article_cate_id', 'content', 'id', 'status'],
|
|
];
|
|
} |