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

use think\Validate;

class PackageGoodsValidate extends Validate
{
    protected $rule =   [
        'goods_name'  => 'require|max:100',
        'package_id'    => 'require',
        'goods_num' => 'require',
        'goods_price' => 'require',
        'goods_weigh' => 'require',
    ];

    protected $message  =   [
        'goods_name'  => '项目名不能为空',
        'package_id'    => '套餐id不能为空',
        'goods_num' => '项目单位不能为空',
        'goods_price' => '项目价格不能为空',
        'goods_weigh' => '项目权重不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['goods_name','package_id','goods_num','goods_price','goods_weigh'],
        'update'   => ['goods_id'],
        'info'     => ['goods_id']
    ];
}
