AdminSeriesValidate.php 1.7 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 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'],
    ];
}