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

use think\Validate;

class PackageGoodsValidate extends Validate
{
    protected $rule =   [
        'goods_name'        => 'require',
        'goods_titile'      => 'require',
        'goods_id'          => 'require',
        'goods_nape'        => 'require',
        'goods_equity'      => 'require',
        'goods_img'         => 'require|min:0',
        'goods_status'      => 'require',
        'goods_num'         => 'require',
        'goods_num_type'    => 'require',
        'goods_num_unit'    => 'require',
    ];

    protected $message  =   [
        'goods_name.require'            => '产品名称称不能为空',
        'goods_id.require'              => 'id不能为空',
        'goods_titile.require'          => '简介不能为空',
        'goods_equity.require'          => '服务权益不能为空',
        'goods_img.require'             => '图片不能为空',
        'goods_nape.require'             => '服务细项不能为空',
        'goods_status.require'          => '状态不能为空',
        'goods_num.require'             => '使用次数不能为空',
        'goods_num_type.require'        => '有效天数不能为空',
        'goods_num_unit.require'        => '单位不能为空',
    ];

    //场景
    protected $scene = [
        'add'           => ['goods_name','goods_titile','goods_equity','goods_img','goods_nape','goods_num','goods_num_unit','goods_num_type',],
        'update'        => ['goods_id'],
        'info'          => ['goods_id'],
        'del'           => ['goods_id']
    ];
}
