本文整理匯總了PHP中CommonModel::get_sku_info方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::get_sku_info方法的具體用法?PHP CommonModel::get_sku_info怎麽用?PHP CommonModel::get_sku_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonModel
的用法示例。
在下文中一共展示了CommonModel::get_sku_info方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intercept_exception_orders
//.........這裏部分代碼省略.........
if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['ebay']) && !empty($orderDataid)) {
//非線下ebay賬號訂單
//ebay 平台可以重新計算運輸方式 @ 20130301
if (empty($countryName)) {
$orderStatus = C('STATESYNCINTERCEPT');
$orderType = C('STATESYNCINTERCEPT_AB');
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
}
if ($actualTotal != $actualTotal0) {
$actualTotal0 = (string) $actualTotal0;
}
echo "[" . date("Y-m-d H:i:s") . "]\t總價記錄---{$ebay_id}---係統總價{$actualTotal}---計算總價{$actualTotal0}\n";
if (in_array($ebay_usermail, array("", "Invalid Request")) && $ebay_carrier == 'EUB') {
$orderStatus = C('STATESYNCINTERCEPT');
$orderType = C('STATESYNCINTERCEPT_AB');
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
} else {
if ($actualTotal != $actualTotal0 && $orderStatus == 1) {
$orderStatus = C('STATESYNCINTERCEPT');
$orderType = C('STATESYNCINTERCEPT_AB');
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
} else {
if (!empty($PayPalEmailAddress) && !in_array(strtolower($PayPalEmailAddress), PaypalEmailModel::get_account_paypalemails($accountId)) && $orderStatus == 1) {
$orderStatus = C('STATESYNCINTERCEPT');
$orderType = C('STATEPENDING_EXCPAY');
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
}
}
}
//$log_data .= "[".date("Y-m-d H:i:s")."]\t自動跳轉的狀態為--".$orderStatus."--".$orderType."!\n\n";
//CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data);
}
if ($orderStatus == C('STATEOUTOFSTOCK')) {
//缺貨和自動攔截判斷
//ebay 線上訂單EUB大於5天,平郵和掛號大於7天不發貨,不包括快遞
//海外銷售十天
$timeout = false;
//$orderDataid = isset($orderData['ebay_orderid']) ? $orderData['ebay_orderid'] : '';
//$ebay_paidtime = isset($orderData['ebay_paidtime']) ? $orderData['ebay_paidtime'] : '';
if (!empty($paymentTime)) {
//線上訂單,付款時間不能為空
$diff_time = ceil((time() - $paymentTime) / (3600 * 24));
if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['ebay'])) {
if ($ebay_carrier == 'EUB' && $diff_time > 5) {
$timeout = true;
} else {
if ((strpos($ebay_carrier, '平郵') !== false || strpos($ebay_carrier, '掛號') !== false) && $diff_time > 7) {
$timeout = true;
}
}
}
/*else if(in_array($GLOBAL_EBAY_ACCOUNT[$accountId],$SYSTEM_ACCOUNTS['海外銷售平台'])){
if((strpos($ebay_carrier, '中國郵政平郵')!==false && $diff_time > 5) || $diff_time > 10){
$timeout = true;
}
}*/
}
if ($timeout) {
//$log_data .= "\n缺貨訂單={$ebay_id}======移動到缺貨需退款中======\n";
$orderStatus = C('STATEREFUND');
$orderType = C('STATEREFUND_OUTSTOCK');
//$log_data .= "[".date("Y-m-d H:i:s")."]\t自動跳轉的狀態為--".$orderStatus."--".$orderType."!\n\n";
//CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data);
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
//continue;
}
}
if (in_array($orderStatus, array(C('STATESTOCKEXCEPTION')))) {
//缺貨處理\合並包裹處理
$have_goodscount = true;
foreach ($orderdetaillist as $orderdetail) {
$sku_arr = GoodsModel::get_realskuinfo($orderdetail['sku']);
foreach ($sku_arr as $or_sku => $or_nums) {
$allnums = $or_nums * $orderdetail['ebay_amount'];
$skuinfo = CommonModel::get_sku_info($or_sku);
$salensend = CommonModel::getpartsaleandnosendall($or_sku);
//$sql = "UPDATE ebay_sku_statistics SET salensend = $salensend WHERE sku = '$or_sku' ";
//self::$dbConn->query($sql);
//$log_data .= "[".date("Y-m-d H:i:s")."]\t---{$sql}\n\n";
//$log_data .= "訂單===$ebay_id===料號==$or_sku===實際庫存為{$skuinfo['realnums']}===需求量為{$allnums}===待發貨數量為{$salensend}===\n";
if (!isset($skuinfo['realnums']) || empty($skuinfo['realnums']) || $skuinfo['realnums'] - $salensend < 0) {
//缺貨本身算待發貨,不能重複扣除
$have_goodscount = false;
break;
}
}
}
if ($have_goodscount) {
/*$orderStatus = C('STATEPENDING');
$orderType = C('STATEPENDING_CONV');*/
$log_data .= "\n缺貨訂單={$ebay_id}======有貨至待打印======\n";
//$final_status = 618;
//$log_data .= "[".date("Y-m-d H:i:s")."]\t自動跳轉的狀態為--".$orderStatus."--".$orderType."!\n\n";
//CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data);
return array('orderStatus' => $orderStatus, 'orderType' => $orderType);
//continue;
}
}
return false;
}