當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonModel::get_hsInfo方法代碼示例

本文整理匯總了PHP中CommonModel::get_hsInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::get_hsInfo方法的具體用法?PHP CommonModel::get_hsInfo怎麽用?PHP CommonModel::get_hsInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonModel的用法示例。


在下文中一共展示了CommonModel::get_hsInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_hsInfo

 /**
  * OrderPrintAct::get_hsInfo()
  * 獲取SPU報關信息 暫時拉取產品中心接口
  * @param array $spus
  * @return void
  */
 public function get_hsInfo($spus)
 {
     $spus = json_encode($spus);
     $key = 'hsInfo' . $spus;
     $data = WhBaseModel::cache($key);
     if (!$data) {
         $data = CommonModel::get_hsInfo($spus);
         if ($data['errCode'] == 200) {
             $data = $data['data'];
             WhBaseModel::cache($key, $data, 24 * 3600);
         } else {
             $data = '';
         }
     }
     return $data;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:22,代碼來源:orderPrint.action.php

示例2: foreach

     $ebay_itemid = $detail['orderDetail']['itemId'];
     //平台產品id
     $ebay_itemtitle = $detail['orderDetailExtension']['itemTitle'];
     $ebay_amount = $detail['orderDetail']['amount'];
     $ebay_itemprice = $detail['orderDetail']['itemPrice'];
     $sku = $sku;
     $ebay_tid = $detail['orderDetailExtension']['transactionID'];
     //交易號
     $onliesku = $detail['orderDetail']['onlinesku'];
     $weight = 0;
     foreach ($detail['skuDetail']['skuInfo'] as $realskus) {
         $weight += $realskus['skuDetail']['goodsWeight'] * $realskus['amount'];
     }
     $weight = $weight > 0 ? $weight : 0.1;
     //取最後一個的報關信息
     $hsinfo = CommonModel::get_hsInfo(json_encode(array($realskus['skuDetail']['spu'])));
     $hsinfo = $hsinfo['data'][$realskus['skuDetail']['spu']];
     $goodsinfo['customsNameEN'] = $hsinfo['customsNameEN'];
     $goodsinfo['customsName'] = $hsinfo['customsName'];
     $customsNameEN = $hsinfo['customsNameEN'] ? $hsinfo['customsNameEN'] : $ebay_itemtitle;
     $customsName = $hsinfo['customsName'] ? $goodsinfo['customsName'] : $ebay_itemtitle;
     $DeclaredValue = 1;
     //不知從哪裏獲取,定義為1
     if (!in_array($ebay_itemid . '-' . $ebay_tid, $unique_item_tid)) {
         $unique_item_tid[] = $ebay_itemid . '-' . $ebay_tid;
         $item[] = array('CurrencyCode' => $ebay_currency, 'EBayEmail' => $ebay_usermail, 'EBayBuyerID' => $ebay_userid, 'EBayItemID' => $ebay_itemid, 'EBayItemTitle' => $ebay_itemtitle, 'EBayMessage' => '', 'EBaySiteID' => "0", 'EBayTransactionID' => $ebay_tid, 'Note' => '', 'OrderSalesRecordNumber' => $recordnumber, 'PaymentDate' => $ebay_paidtime, 'PayPalEmail' => "0", 'PayPalMessage' => '', 'PostedQTY' => $ebay_amount, 'ReceivedAmount' => $ebay_total, 'SalesRecordNumber' => $recordnumber, 'SoldDate' => $ebay_createdtime, 'SoldPrice' => $ebay_itemprice, 'SoldQTY' => $ebay_amount, 'SKU' => array('SKUID' => $sku, 'Weight' => $weight * $ebay_amount, 'CustomsTitleCN' => $customsName, 'CustomsTitleEN' => $customsNameEN . ' ' . $sku, 'DeclaredValue' => $DeclaredValue * $ebay_amount, 'OriginCountryName' => "China", 'OriginCountryCode' => "CN"));
     }
 }
 sort($item);
 //EUB異常訂單申請訂單,修改料號,沒有對應的物品交易號,不能申請跟蹤號問題解決
 $params = array('Version' => "3.0.0", 'APIDevUserID' => $APIDevUserID, 'APIPassword' => $APIPassword, 'APISellerUserID' => $APISellerUserID, 'MessageID' => "135625622432", "OrderDetail" => array("PickUpAddress" => $PickUpAddress, "ShipFromAddress" => $ShipFromAddress, "ShipToAddress" => $ShipToAddress, "ItemList" => array("Item" => $item), "EMSPickUpType" => $shiptype, "ReturnAddress" => $ReturnAddress));
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:wh_eub_tracknumber_ebay.php


注:本文中的CommonModel::get_hsInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。