/**
  * sku信息列表.
  *
  * @param $oriPrice
  * @param $price
  * @param $iconUrl
  * @param $quantity
  * @param null $skuId
  *
  * @return $this
  */
 public function setSkuList($oriPrice, $price, $iconUrl, $quantity, $skuId = null)
 {
     $data = array('ori_price' => $oriPrice, 'price' => $price, 'icon_url' => $iconUrl, 'quantity' => $quantity);
     if (is_array($skuId)) {
         $skuId = Stock::getSkuInfo($skuId);
     }
     if (!empty($skuId)) {
         $data['sku_id'] = $skuId;
     }
     $this->attributes['sku_list'][] = $data;
     return $this;
 }
Exemple #2
0
 public function testGetSkuInfo()
 {
     $stock = new Stock($this->http);
     $data = $stock->getSkuInfo(array(array('a', 'a1'), array('b', 'b1')));
     $this->assertEquals('a:a1;b:b1', $data);
 }