callmez\wechat\sdk\Wechat::addProductStock PHP Method

addProductStock() public method

增加库存
public addProductStock ( $productId, $quantity, array $skuInfo = null ) : boolean
$productId 商品ID
$quantity 增加的库存数量
$skuInfo array sku信息,格式"id1:vid1;id2:vid2",如商品为统一规格,则此处赋值为空字符串即可
return boolean
    public function addProductStock($productId, $quantity, array $skuInfo = null)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_PRODUCT_STOCK_ADD_URL . 'access_token=' . $this->getAccessToken(), ['product_id' => $productId, 'quantity' => $quantity, 'sku_info' => $skuInfo === null ? $skuInfo : implode(':', $skuInfo)]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
Wechat