本文整理匯總了PHP中CommonModel::getTransCarrierInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::getTransCarrierInfo方法的具體用法?PHP CommonModel::getTransCarrierInfo怎麽用?PHP CommonModel::getTransCarrierInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonModel
的用法示例。
在下文中一共展示了CommonModel::getTransCarrierInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: exit
//預先判斷ebaytoken文件
$__token_file = WEB_PATH_CONF_SCRIPTS_KEYS_EBAY . 'keys_' . $__ebayaccount . '.php';
if (!file_exists($__token_file)) {
exit($__token_file . " does not exists!!!");
}
$express_delivery = array();
$express_delivery_value = array();
$no_express_delivery = array();
$no_express_delivery_value = array();
$express_delivery_arr = CommonModel::getTransCarrierInfo(1);
foreach ($express_delivery_arr['data'] as $value) {
$express_delivery_value[$value['id']] = $value['carrierNameCn'];
}
$express_delivery = array_keys($express_delivery_value);
//var_dump($express_delivery);
$no_express_delivery_arr = CommonModel::getTransCarrierInfo();
foreach ($no_express_delivery_arr['data'] as $value) {
$no_express_delivery_value[$value['id']] = $value['carrierNameCn'];
}
$no_express_delivery = array_keys($no_express_delivery_value);
//var_dump($no_express_delivery); exit;
#########全局變量設置########
date_default_timezone_set('Asia/Chongqing');
$detailLevel = 0;
$Sordersn = "eBay";
$mctime = time();
$cc = $mctime;
$nowtime = date("Y-m-d H:i:s", $cc);
$nowd = date("Y-m-d", $cc);
#################以下賬號用於測試#############
$account = $__ebayaccount;
示例2: addOrder
public function addOrder($account)
{
if (!defined('WEB_PATH')) {
define("WEB_PATH", "/data/web/order.valsun.cn/");
}
require_once WEB_PATH . "crontab/scripts.comm.php";
require_once WEB_PATH_CONF_SCRIPTS . "script.ebay.config.php";
require_once WEB_PATH_LIB_SDK_EBAY . "GetCertainOrder.php";
require_once WEB_PATH_LIB_SCRIPTS_EBAY . "ebay_order_cron_func.php";
$rmq_config = C("RMQ_CONFIG");
$rabbitMQClass = new RabbitMQClass($rmq_config['fetchOrder'][1], $rmq_config['fetchOrder'][2], $rmq_config['fetchOrder'][4], $rmq_config['fetchOrder'][0]);
//隊列對象
$omAvailableAct = new OmAvailableAct();
$where = 'WHERE is_delete=0 ';
$where .= 'AND platformId in(1,5) ';
$GLOBAL_EBAY_ACCOUNT = $omAvailableAct->act_getTNameList2arrById('om_account', 'id', 'account', $where);
$FLIP_GLOBAL_EBAY_ACCOUNT = array_flip($GLOBAL_EBAY_ACCOUNT);
if (!preg_match('#^[\\da-zA-Z]+$#i', $account)) {
$message .= "<font color='red'>Invalid ebay account: {$account}!</font><br>";
self::$errCode = 101;
self::$errMsg = $mesage;
return false;
}
if (!in_array($account, $GLOBAL_EBAY_ACCOUNT)) {
//exit("$account is not support now !\n");
$message .= "<font color='red'>{$account} is not support now !</font><br>";
self::$errCode = 102;
self::$errMsg = $mesage;
return false;
}
//預先判斷ebaytoken文件
$__token_file = WEB_PATH_CONF_SCRIPTS_KEYS_EBAY . 'keys_' . $account . '.php';
if (!file_exists($__token_file)) {
//exit($__token_file." does not exists!!!");
$message .= "<font color='red'>{$__token_file} does not exists!!!</font><br>";
self::$errCode = 103;
self::$errMsg = $mesage;
return false;
}
$express_delivery = array();
$express_delivery_value = array();
$no_express_delivery = array();
$no_express_delivery_value = array();
$express_delivery_arr = CommonModel::getTransCarrierInfo(1);
foreach ($express_delivery_arr['data'] as $value) {
$express_delivery_value[$value['id']] = $value['carrierNameCn'];
}
$express_delivery = array_keys($express_delivery_value);
//var_dump($express_delivery);
$no_express_delivery_arr = CommonModel::getTransCarrierInfo();
foreach ($no_express_delivery_arr['data'] as $value) {
$no_express_delivery_value[$value['id']] = $value['carrierNameCn'];
}
$no_express_delivery = array_keys($no_express_delivery_value);
//var_dump($no_express_delivery); exit;
#########全局變量設置########
date_default_timezone_set('Asia/Chongqing');
$detailLevel = 0;
$Sordersn = "eBay";
$mctime = time();
$cc = $mctime;
$nowtime = date("Y-m-d H:i:s", $cc);
$nowd = date("Y-m-d", $cc);
#################以下賬號用於測試#############
//$account= $__ebayaccount;
#############類或API 實例化##############
$api_gco = new GetCertainOrderAPI($account);
//$oa =new OrderAction();
//程序計時器
$time_start = $cc;
//echo "\n=====[".date('Y-m-d H:i:s',$time_start)."] 係統【開始】抓取賬號【 $account 】訂單 ====>\n\n";
$message = $api_gco->GetCertainOrder($account);
//監聽獲取隊列信息
if ($message === true) {
self::$errCode = 200;
self::$errMsg = "成功抓取訂單!";
return true;
} elseif ($message === false) {
self::$errCode = 104;
self::$errMsg = "抓取訂單失敗!";
return false;
} else {
self::$errCode = 105;
self::$errMsg = $message;
return;
}
//return $message;
}