<?php
namespace app\admin\validate\home;

use think\Validate;

class HomeBannerValidate extends Validate
{
    protected $rule =   [
        'banner_name'  => 'require|max:100',
        'banner_id'    => 'require',
        'banner_category_id' => 'require',
        'banner_img' => 'require',
    ];

    protected $message  =   [
        'banner_name'  => 'banner名不能为空',
        'banner_id'    => 'banner_id不能为空',
        'banner_category_id' => '分类不能为空',
        'banner_img' => 'banner图不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['banner_name','banner_category_id','banner_img'],
        'update'   => ['banner_id'],
        'info'     => ['banner_id']
    ];
}
