'checkGoods', 'initiate_id' => 'require', ]; protected $message = [ 'initiate_id.require' => '发起砍价ID缺失' ]; protected $scene = [ 'goods' => ['goods_id'], 'initiate' => ['initiate_id'], ]; protected function checkGoods($value,$rule,$data){ $goods = Goods::find($value); if(empty($goods)){ return '商品不存在'; } if(GoodsEnum::STATUS_STORAGE == $goods->status){ return '商品已下架'; } return true; } }