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


PHP CommonModel::getpartsaleandnosendall方法代碼示例

本文整理匯總了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'];
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:22,代碼來源:oldsystem.model.php

示例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;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:101,代碼來源:cndl.model.php

示例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;
        }
    }
開發者ID:ohjack,項目名稱:newErp,代碼行數:63,代碼來源:superOrder.model.php

示例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'] = "";
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:warehouse_history_read.php


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