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