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

use think\Validate;

class RaiseOldGoodsValidate extends Validate
{
    protected $rule =   [
        'goods_name'  => 'require|max:20',
        'goods_id'    => 'require',
        'goods_price' => 'require',
        'goods_time' => 'require',
        'goods_category_id' => 'require',
        'goods_shop_id' => 'require',
        'goods_status' => 'require',
    ];

    protected $message  =   [
        'goods_id.require' => '养老产品ID不能为空',
        'goods_name.require' => '养老产品名称不能为空',
        'goods_price.require'=> '养老产品价格不能为空',
        'goods_time.require'   => '养老产品时间不能为空',
        'goods_name.max'  => '养老产品名称不能超过20字',
        'goods_category_id.require' => '养老产品分类不能为空',
        'goods_shop_id.require' => '养老产品店铺id不能为空',
        'goods_status.require' => '养老产品状态不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['goods_name','goods_title','goods_time','goods_category_id','goods_price','goods_shop_id','goods_status'],
        'update'   => ['goods_id','goods_name','goods_title','goods_time','goods_category_id','goods_price','goods_shop_id','goods_status'],
        'info'     => ['goods_id']
    ];
}
