Ejemplo n.º 1
0
 private function getDetail($id)
 {
     define('M_ROOT', dirname(dirname(__FILE__)));
     $ss = M_ROOT;
     $str = str_replace("\\", "/", $ss);
     include_once $str . "/API/taobao/TopSdk.php";
     $c = new \TopClient();
     $c->appkey = '23151483';
     $c->secretKey = 'aa5a861b141f7e294ed088315da46867';
     //淘宝客商品详情查询
     $req = new \TbkItemInfoGetRequest();
     $req->setFields("volume,num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url");
     $req->setPlatform(1);
     $req->setNumIids($id);
     $resp = $c->execute($req);
     //淘宝客商品详情(有销量)
     $reqs = new \TbkItemsDetailGetRequest();
     $reqs->setTrackIids($id);
     $reqs->setFields("num_iid,seller_id,nick,title,price,volume,pic_url,item_url,shop_url,click_url");
     $reqs->setNumIids($id);
     $resps = $c->execute($reqs);
     $tt = $resp->results->n_tbk_item;
     foreach ($tt->small_images->string as $k => $v) {
         $all .= $v . ',';
     }
     $back->image = rtrim($all, ",");
     //$yishou = $resps->tbk_items->tbk_item->volume;
     $yishou = $resp->results->n_tbk_item->volume;
     $back->yishou = $yishou;
     return $back;
 }
Ejemplo n.º 2
0
<?php

include 'tao-sdk/TopSdk.php';
$c = new TopClient();
$c->format = 'json';
$c->appkey = '23124076';
$c->secretKey = '4e85b27be20292da10c30fcd115e07b1';
$req = new TbkItemsDetailGetRequest();
$req->setTrackIids("");
$req->setFields("num_iid,seller_id,nick,title,price,volume,pic_url,item_url,shop_url");
$req->setNumIids("37301356780");
$resp = $c->execute($req);
var_dump($resp);
Ejemplo n.º 3
0
 function extends_info($goods_list)
 {
     global $_G;
     if (!$this->parse) {
         return;
     }
     $ids = $this->get_iids($goods_list);
     include_once ROOT_PATH . 'top/tbk/TbkItemsDetailGetRequest.php';
     $req = new TbkItemsDetailGetRequest();
     $req->setFields("num_iid,seller_id,nick,title,price,volume,pic_url,item_url,shop_url,click_url");
     $req->setNumIids($ids);
     $resp = $_G['TOP']->execute($req);
     top_check_error($resp, $this->show_error);
     $data = $this->parse_info($resp);
     foreach ($data as $k => $v) {
         $iid = $v['num_iid'];
         $goods_list[$iid] = array_merge($goods_list[$iid], $v);
     }
     return $goods_list;
 }
Ejemplo n.º 4
0
function tbkGoodsInfo($goodiid = '')
{
    require_once ROOT . '/plus/taobaoke/TopSdk.php';
    $c = new TopClient();
    $c->appkey = '23188977';
    $c->secretKey = '0591664547cf8ee5e241c1a8e76efa2d';
    //淘宝客商品详情
    $req = new TbkItemsDetailGetRequest();
    $req->setFields("num_iid,seller_id,nick,title,price,volume,pic_url,item_url,shop_url,click_url,discount_price");
    $req->setNumIids($goodiid);
    $resp = $c->execute($req);
    return $resp;
}
Ejemplo n.º 5
0
 function extends_info()
 {
     global $_G;
     if (!$this->parse) {
         return;
     }
     $ids = $this->get_iids($this->goods_list);
     include_once ROOT_PATH . 'top/tbk/TbkItemsDetailGetRequest.php';
     $req = new TbkItemsDetailGetRequest();
     $req->setFields("num_iid,seller_id,nick,title,price,volume,pic_url,item_url,shop_url,click_url");
     $req->setNumIids($ids);
     $resp = $_G['TOP']->execute($req);
     top_check_error($resp, $this->show_error);
     $this->parse_info_j($resp);
 }