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

use think\Validate;

class MedicalCarePostagetValidate extends Validate
{
    protected $rule =   [
        'postage_id'                => 'require',
        'postage_name'              => 'require',
        'postage_type_id'           => 'require',
        'postage_first_weight'      => 'require',
        'postage_first_price'       => 'require',
        'postage_extend_weight'     => 'require',
        'postage_extend_price'      => 'require',
    ];

    protected $message  =   [
        'postage_id.require'             => '模板ID不能为空',
        'postage_name.require'           => '模板名称不能为空',
        'postage_type_id.require'        => '模板类型不能为空',
        'postage_first_weight.require'   => '首重不能为空',
        'postage_first_price.require'    => '产品状态不能为空',
        'postage_extend_weight.require'  => '续重不能为空',
        'postage_extend_price.require'   => '续费能为空',
    ];

    //场景
    protected $scene = [
        'add'           => [
            'postage_name','postage_type_id','postage_first_weight',
            'postage_first_price','postage_extend_weight','postage_extend_price',
            ],
        'update'        => [
            'postage_name','postage_type_id','postage_first_weight',
            'postage_first_price','postage_extend_weight','postage_extend_price','postage_id'
        ],
        'info'          => ['postage_id'],
        'del'           => ['postage_id']
    ];
}
