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']); $data['yunfei_price'] = $product['yunfei_price']; $data['total_price'] = bcmul($data['sales_price'],$number,2); return $data; } }