getBaseData($this->getData(), $spec); if ($data['stock'] < 1) { throw new Exception('产品库存不足'); } $product = $this->getData(); $data['title'] = $product['title']; $data['spec'] = $spec; $data['number'] = $number; $data['id'] = Hashids::encodeHex($product['id']); return $data; } }