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

use think\Validate;

class ShopValidate extends Validate
{
    protected $rule =   [
        'shop_id'               => 'require',
        'shop_name'             => 'require',
        'shop_logo'             => 'require',
        'shop_label'            => 'require',
        'shop_business_hours'   => 'require',
        'shop_type'             => 'require',
        'shop_address'          => 'require',
        'shop_is_auto'          => 'require',
        'shop_lat'              => 'require',
        'shop_lng'              => 'require',
        'shop_phone'            => 'require',
        'shop_real_name'        => 'require',
    ];

    protected $message  =   [
        'shop_id.require'               => '店铺不能为空',
        'shop_name.require'             => '店铺名称不能为空',
        'shop_logo.require'             => 'LOGO不能为空',
        'shop_label.require'            => '标签',
        'shop_business_hours.require'   => '店铺营业时间不能为空',
        'shop_type.require'             => '产品销量不能为空',
        'shop_address.require'          => '店铺类型不能为空',
        'shop_is_auto.require'          => '是否需要审核不能为空',
        'shop_lat.require'              => '经度不能为空',
        'shop_lng.require'              => '纬度不能为空',
        'shop_phone.require'            => '店铺电话不能为空',
        'shop_real_name.require'        => '负责人不能为空',
    ];

    //场景
    protected $scene = [
        'add'           => [
            'shop_name','shop_logo','shop_label',
            'shop_business_hours','shop_type','shop_address',
            'shop_is_auto','shop_lat','shop_lng','shop_phone',
            'shop_real_name'
            ],
        'update'        => [
            'shop_name','shop_logo','shop_label',
            'shop_business_hours','shop_type','shop_address',
            'shop_is_auto','shop_lat','shop_lng','shop_phone',
            'shop_real_name','shop_id'
        ],
        'info'          => ['shop_id'],
        'del'           => ['shop_id']
    ];
}
