本文整理汇总了PHP中CommonModel::getpartsaleandnosendall方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonModel::getpartsaleandnosendall方法的具体用法?PHP CommonModel::getpartsaleandnosendall怎么用?PHP CommonModel::getpartsaleandnosendall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonModel
的用法示例。
在下文中一共展示了CommonModel::getpartsaleandnosendall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getpartsaleandnosendall
public static function getpartsaleandnosendall($sku, $isCache = true)
{
require_once WEB_PATH . "api/include/functions.php";
$url = 'http://gw.open.valsun.cn:88/router/rest?';
$paramArr = array('method' => 'order.erp.getpartsaleandnosendall', 'format' => 'json', 'v' => '1.0', 'username' => 'purchase', 'sku' => $sku);
$result = callOpenSystem($paramArr, $url);
$data = json_decode($result, true);
if (empty($data['data'])) {
$data['data'] = CommonModel::getpartsaleandnosendall($sku);
//添加新系统待发货数量
}
/*if(empty($data['data'])){
return false;
}*/
if ($isCache) {
//同步更新待发货缓存表
$sendArr = array('salensend' => $data['data']);
CommonModel::updateSkuStatistics($sku, $sendArr);
}
//var_dump($data['data']);
return $data['data'];
}
示例2: 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;
}
示例3: showOrderAPI
public static function showOrderAPI($purchaseId, $storeId = 1)
{
// 提供超大订单数据
!self::$dbConn ? self::initDB() : null;
//echo time(); echo "<br>";
//!self::$dbConn ? self::initDB() : null;
//取出两个where 下的所有订单
/*if(!empty($whereDetail)){
$orderIdStr =implode(",",self::api_getOrdIdByDetWhe($whereDetail));
}
if(!empty($whereOrder)){
$whereOrder = "AND ".$whereOrder;
}*/
/*if(!empty($orderIdStr)){
$whereOrder .= " AND id in ({$orderIdStr})";
}*/
$showOrder = array();
$ordersql = 'SELECT a.id as orderid, a.accountId, b.sku, b.amount
FROM om_unshipped_order AS a
LEFT JOIN om_unshipped_order_detail AS b
ON b.omOrderId = a.id
WHERE a.orderStatus = ' . C('STATEOVERSIZEDORDERS') . '
AND a.orderType != ' . C('STATEOVERSIZEDORDERS_CONFIRM') . '
AND a.is_delete=0
AND b.is_delete=0
AND a.storeId= ' . $storeId;
//echo $ordersql; echo "<br>"; exit;
$query = self::$dbConn->query($ordersql);
$orders = self::$dbConn->fetch_array_all($query);
//echo count($orders); exit;
//echo time(); echo "<br>"; exit;
foreach ($orders as $ordervalue) {
$orderid = $ordervalue['orderid'];
$sku = $ordervalue['sku'];
//$amount = $ordervalue['amount'];
//echo $sku; echo "<br>";
$skus = GoodsModel::get_realskuinfo($sku);
//var_dump($skus); echo "<br>"; exit;
foreach ($skus as $_sku => $_num) {
$_skuinfo = GoodsModel::getSkuinfoByPurchaseId($_sku, $purchaseId);
//var_dump($_skuinfo); echo "<br>"; exit;
if ($_skuinfo) {
$auditRecord = CommonModel::getRecordsOrderAudit($orderid, $_sku);
$accountInfo = OmAccountModel::accountInfo($accountId);
//var_dump($accountInfo); echo "<br>"; exit;
//echo $_sku; echo "<br>";
$nosaleand = CommonModel::getpartsaleandnosendall($_sku);
//var_dump($nosaleand); echo "<br>"; exit;
$ordervalue['accountId'] = $accountInfo['account'];
$ordervalue['sku'] = $_skuinfo;
$ordervalue['auditRecord'] = $auditRecord;
$ordervalue['nosaleand'] = $nosaleand;
//var_dump($ordervalue); echo "<br>";
$showOrder[] = $ordervalue;
}
}
}
if (!empty($showOrder)) {
return json_encode($showOrder);
} else {
return false;
}
}
示例4:
$enable = 0;
}
if ($enable == 0) {
continue;
}
if ($sf['goods_location'] == "停售") {
continue;
}
/*if(in_array($key,$__liquid_items_postbyhkpost)||in_array($key,$__liquid_items_cptohkpost)||in_array($key,$__liquid_items_BuiltinBattery)||in_array($key,$__liquid_items_Paste)){
continue;
}*/
/*$ss = "SELECT goods_count FROM ebay_onhandle WHERE goods_sn='$key'";
$ss = $dbConn->query($ss);
$ss = $dbConn->fetch_array($ss);*/
$goods_count = WarehouseAPIModel::getSkuStock($key);
$salensend = CommonModel::getpartsaleandnosendall($key);
$useable_stock = $goods_count - $salensend;
if ($useable_stock > 0) {
$now_status = '1';
} else {
$now_status = '0';
}
$sql = "SELECT * FROM om_adjust_sku WHERE sku='{$key}' and type=1 order by createdtime desc";
$sql = $dbConn->query($sql);
$sql = $dbConn->fetch_array($sql);
if ($sql) {
if ($now_status == $sql['adjustvalue']) {
continue;
}
} else {
$sql['adjustvalue'] = "";