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

use think\Validate;

class ShopCategoryValidate extends Validate
{
    protected $rule =   [
        'category_id'           => 'require',
        'category_pid'          => 'require',
        'category_shop_id'      => 'require',
        'category_name'         => 'require',
        'category_sort'         => 'require',
    ];
    protected $message  =   [
        'category_id.require'       => '店铺分类id不能为空',
        'category_pid.require'      => '店铺分类上级id不能为空',
        'category_shop_id.require'  => '所属店铺不能为空',
        'category_name.require'     => '分类名称不能为空',
        'category_sort.require'     => '排序不能为空',
    ];
    //场景
    protected $scene = [
        'add'           => [
            'category_pid',
            'category_shop_id',
            'category_name',
            'category_sort'
            ],
        'update'        => [
            'category_id',
            'category_pid',
            'category_shop_id',
            'category_name',
            'category_sort'
        ],
        'info'          => ['category_id'],
        'del'           => ['category_id']
    ];
}
