Skip to content
HanSon edited this page Mar 9, 2017 · 2 revisions

使用

$product = $app->product;
  • 上传商品
       $app->product->add([
            'title' => 'test' . rand(),
            'price' => rand(),
            'post_fee' => '0',
            'sku_outer_ids' => '123,124',
            'sku_prices' => '3.00,40000.00',
            'sku_quantities' => '3,4',
            'sku_properties' => '颜色:黄色;尺寸:M,颜色:黄色;尺寸:S'
        ], [
            'images' => [
                __DIR__ . '/img/head.jpg',
                __DIR__ . '/img/gcu.jpg',
            ]
        ]);

        // 或者单图的时候
        $app->product->add([
            'title' => 'test' . rand(),
            'price' => rand(),
            'post_fee' => '0',
        ], [
            'images[]' => __DIR__ . '/img/gcu.jpg',
        ]);
  • 更新商品$app->product->update($param);
  • 上架商品$app->product->listing($param);
  • 下架商品$app->product->delisting($param);
  • 获取商品$app->product->get($param);
  • 获取上架商品$app->product->getListing($param);
  • 获取下架商品$app->product->getDelisting($param);
  • 批量上架商品$app->product->batchListing($num_iids);
  • 批量下架商品$app->product->batchDelisting($num_iids);
  • 查找单个商品$app->product->find($param);
  • 获取商品SKU$app->product->getSku($param);
  • 更新商品SKU$app->product->updateSku($param);
  • 删除商品$app->product->delete($numIid);
Clone this wiki locally