function get($cate_id = 0) { global $_G; $req = new ItemcatsGetRequest(); //$req->setFields("cid,parent_cid,name,is_parent"); $req->setFields("cid,name"); $req->setParentCid($cate_id); $resp = $_G['TOP']->execute($req); top_check_error($resp, 1); return $this->parse($resp->item_cats->item_cat); }
function delete_channel($name) { global $_G; if (!class_exists('SpContentDeleteclassRequest')) { include_once ROOT_PATH . 'top/request/SpContentDeleteclassRequest.php'; } $req = new SpContentDeleteclassRequest(); $req->setSiteKey($_G['setting'][sitekey]); $req->setClassname($name); $resp = $_G['TOP']->execute($req); if (!$resp->is_success) { top_check_error($resp, $this->show_error, true); } return $resp; }
function get_shop($sid) { global $_G; if (!$sid) { return false; } $req = new SpShopInfoGetRequest(); $req->setSiteKey($_G[setting][sitekey]); $req->setSellerId($sid); $resp = $_G['TOP']->execute($req); top_check_error($resp, true); $arr = array(); $arr['nick'] = ''; $arr['sid'] = $sid; $arr['cid'] = 0; $arr['title'] = $resp->shop->shop_title; $arr['desc'] = ''; $arr['url'] = $resp->shop->shop_url; $arr['type'] = $resp->shop->tmall == 1 ? 2 : 1; $arr['pic_path'] = ''; return $arr; }
function post($phone, $type, $password) { global $_G; if (!is_phone($phone)) { msg('手机号码不正确'); } $this->init($type); include_once ROOT_PATH . 'top/baichuan/OpenSmsSendmsgRequest.php'; $req = new OpenSmsSendmsgRequest(); $arr['template_id'] = $this->tplid; $arr['signature_id'] = $this->signature_id; $arr['context'] = array('appName' => $_G['setting']['title'], 'code' => $password); $arr['external_id'] = 'change_password'; $arr['mobile'] = $phone; $SendMessageRequest = json_encode($arr); $req->setSendMessageRequest($SendMessageRequest); $resp = $_G['TOP']->execute($req); top_check_error($resp, true); $rs = $resp->result; if (!$rs->successful) { $this->save_session('post_' . $type . '_' . $phone); if ($this->debug) { L('发送修改密码短信错误:' . $rs->message . ',手机号' . $phone . ',domain:' . $arr['domain']); } return $rs->message; } else { return true; } }
function get_ext_info($open_iids, $all = false) { global $_G; if (is_array($open_iids)) { $open_iids = implode(',', $open_iids); } $req = new AtbItemsDetailGetRequest(); //http://open.taobao.com/apidoc/dataStruct.htm?spm=a219a.7386789.0.0.4vyC0e&path=scopeId:11483-dataStructId:115030-apiId:23806-invokePath:atb_item_details.item //上方字段都可获取 //desc $fd = "open_iid,detail_url,num,freight_payer,approve_status,item_imgs,post_fee,express_fee,ems_fee,item_img.url,nick"; if ($all) { $fd .= ",title,cid,pic_url,location,shop_type,price"; } if ($_G['setting']['get_message']) { $fd .= ",desc"; } $req->setFields($fd); $req->setOpenIids($open_iids); $resp = $_G['TOP']->execute($req); top_check_error($resp, 1); $rt = $this->parse_ext_info($resp, $all); return $rt; }
function get_recommend($relate_type, $id, $size = 20) { global $_G; include_once ROOT_PATH . 'top/tbk/TbkItemRecommendGetRequest.php'; $req = new TbkItemRecommendGetRequest(); $req->setFields("num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url"); $req->setRelateType($relate_type); if ($relate_type == 4) { $req->setUserId($id); } else { if ($relate_type == 5) { $req->setCat($id); } else { $req->setNumIid($id); } } $req->setCount($size); $req->setPlatform(1); $resp = $_G['TOP']->execute($req); top_check_error($resp, 1); $rs = $this->parse_info($resp); return $rs; }
function get_sku($num_iid, $open_iid) { global $_G; if (!$num_iid && !$open_iid) { return false; } if (!class_exists('TaeItemDetailGetRequest')) { include_once ROOT_PATH . 'top/baichuan/TaeItemDetailGetRequest.php'; } if (!$open_iid) { $rs = $this->get_goods($num_iid); $open_iid = $rs['open_iid']; } $req = new TaeItemDetailGetRequest(); //$req->setFields("itemInfo,priceInfo,skuInfo,stockInfo,rateInfo,descInfo,sellerInfo,mobileDescInfo,deliveryInfo,storeInfo,itemBuyInfo,couponInfo"); $req->setFields("priceInfo,skuInfo,stockInfo"); $req->setOpenIid($open_iid); $resp = $_G['TOP']->execute($req, $sessionKey); top_check_error($resp, true); $rs = $resp->data; return $rs; }