AdminSeriesValidate.php
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;
use think\Validate;
class AdminSeriesValidate extends Validate
{
protected $rule = [
'title' => 'require|max:80',
'title_en' => 'require|max:80',
'thumbnail' => 'require|max:100',
'hotline' => 'require',
'detail' => 'require',
'detail_en' => 'require',
];
protected $message = [
'title.require' => '标题不能为空',
'title.max' => '标题不能超多80个字符',
'title_en.require' => '标题(英文)不能为空',
'title_en.max' => '标题(英文)不能超多80个字符',
'thumbnail.require' => '请上传缩略图',
'hotline.require' => '电话咨询不能为空',
'detail.require' => '详情不能为空',
'detail_en.require' => '详情(英文)不能为空',
];
protected $scene = [
'edit' => ['title','title_en','thumbnail','hotline','detail','detail_en'],
];
}