@@ 41-51 (lines=11) @@ | ||
38 | * @return bool |
|
39 | * @throws ShopsException |
|
40 | */ |
|
41 | public function add($productId, $quantity, $skuInfo = null) |
|
42 | { |
|
43 | $this->response = $this->http->jsonPost(self::API_ADD,array( |
|
44 | 'product_id' => $productId, |
|
45 | 'sku_info' => is_null($skuInfo) ? '' : $this->getSkuInfo($skuInfo), |
|
46 | 'quantity' => $quantity |
|
47 | )); |
|
48 | ||
49 | return $this->getResponse(); |
|
50 | ||
51 | } |
|
52 | ||
53 | /** |
|
54 | * 减少库存 |
|
@@ 62-71 (lines=10) @@ | ||
59 | * @return bool |
|
60 | * @throws ShopsException |
|
61 | */ |
|
62 | public function reduce($productId, $quantity, $skuInfo = null) |
|
63 | { |
|
64 | $this->response = $this->http->jsonPost(self::API_REDUCE,array( |
|
65 | 'product_id' => $productId, |
|
66 | 'sku_info' => is_null($skuInfo) ? '' : $this->getSkuInfo($skuInfo), |
|
67 | 'quantity' => $quantity |
|
68 | )); |
|
69 | ||
70 | return $this->getResponse(); |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * 拼装 SkuInfo Str |