本文整理汇总了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;
}