AdminServiceValidate.php
1.5 KB
<?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 AdminServiceValidate extends Validate
{
protected $rule = [
'name' => 'require|max:80',
'name_en' => 'require|max:80',
'detail' => 'require',
'detail_en' => 'require',
];
protected $message = [
'name.require' => '分类名称不能为空',
'name.max' => '分类名称不能超过80个字符',
'name_en.require' => '分类名称(英文)不能为空',
'name_en.max' => '分类名称(英文)不能超过80个字符',
'detail.require' => '详情不能为空',
'detail_en.require' => '详情(英文)不能为空',
];
protected $scene = [
'edit' => ['name','name_en','detail','detail_en'],
];
}