当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonModel::calcAddOrderWeight方法代码示例

本文整理汇总了PHP中CommonModel::calcAddOrderWeight方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonModel::calcAddOrderWeight方法的具体用法?PHP CommonModel::calcAddOrderWeight怎么用?PHP CommonModel::calcAddOrderWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommonModel的用法示例。


在下文中一共展示了CommonModel::calcAddOrderWeight方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql_real_escape_string

     $ShenBaoQuantity = mysql_real_escape_string(trim($detail['ShenBaoQuantity']));
     $ShenBaoUnitPrice = mysql_real_escape_string(trim($detail['ShenBaoUnitPrice']));
     $salePrice = round_num(mysql_real_escape_string(trim($detail['SalePrice'])), 2);
     //实际SKU付款价
     /*************END 订单详细扩展表数据***************/
     /*$sql = array2sql($orderDetailExtDL);
     		$msg = DLdlModel::insertOrderDetailExtDL($sql);
     		if(!$msg){
     			echo "订单{$orderdata['recordnumber']}订单明细扩展信息插入失败!\r\n";
     			BaseModel::rollback();
     		}*/
     $obj_order_detail_data[] = array('orderDetailData' => $orderdata_detail, 'orderDetailExtenData' => $orderDetailExtDL);
     $ebay_fedex_remark[$categoryName][] = array('real_price' => $ShenBaoQuantity, 'qty' => $ShenBaoUnitPrice, 'hamcodes' => $customCode, 'detail' => $material);
 }
 $insertOrder = array('orderData' => $orderdata, 'orderExtenData' => $orderExtDL, 'orderUserInfoData' => $orderUserInfo, 'orderDetail' => $obj_order_detail_data, 'orderNote' => $orderNote);
 $calcInfo = CommonModel::calcAddOrderWeight($insertOrder['orderDetail']);
 //计算重量和包材
 //var_dump($calcInfo); exit;
 $insertOrder['orderData']['calcWeight'] = $calcInfo[0];
 $insertOrder['orderData']['pmId'] = $calcInfo[1];
 //$insertOrder['orderData']['transportId'] = $flip_transportList[get_carrier($insertOrder['orderData']['calcWeight'], $insertOrder['orderUserInfoData']['countryName'])];
 $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, 1);
 //计算运费
 //var_dump($calcShippingInfo); exit;
 //$insert_orderData['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
 $insertOrder['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
 $insertOrder = AutoModel::auto_contrast_intercept($insertOrder);
 $omOrderId = OrderAddModel::insertAllOrderRow($insertOrder, 'cndl');
 if ($omOrderId) {
     echo "订单 {$orderdata['recordnumber']} 信息添加成功!ERP订单号为{$omOrderId}--" . date("Y-M-d H:i:s", $mctime) . "--\n";
 }
开发者ID:ohjack,项目名称:newErp,代码行数:31,代码来源:fetch_DL_orders.php

示例2: auto_contrast_intercept

 public static function auto_contrast_intercept($orderData)
 {
     global $SYSTEM_ACCOUNTS, $__liquid_items_fenmocsku, $__liquid_items_BuiltinBattery, $__liquid_items_SuperSpecific, $__liquid_items_Paste;
     global $GLOBAL_EBAY_ACCOUNT;
     global $express_delivery, $no_express_delivery;
     if (!$SYSTEM_ACCOUNTS) {
         $__liquid_items_array = PurchaseAPIModel::getAdjustransportFromPurchase();
         //var_dump($__liquid_items_array);
         //echo time(); echo "<br>";
         $__liquid_items_postbyhkpost = array_filter(explode(",", $__liquid_items_array['液体产品']));
         //液体产品
         $__liquid_items_postbyfedex = array_filter(explode(",", $__liquid_items_array['贵重产品']));
         //贵重物品走联邦
         $__liquid_items_cptohkpost = array_filter(explode(",", $__liquid_items_array['指甲油产品']));
         //指甲油转香港小包
         $__liquid_items_elecsku = array_filter(explode(",", $__liquid_items_array['电子类产品']));
         //电子类产品走香港小包
         //$__elecsku_countrycn_array = array_filter(explode(",", $__liquid_items_array['']));//电子类产品指定国家
         $__liquid_items_fenmocsku = array_filter(explode(",", $__liquid_items_array['粉末状产品']));
         //粉末状SKU
         $__liquid_items_BuiltinBattery = array_filter(explode(",", $__liquid_items_array['内置电池产品']));
         //内置电池类产品
         $__liquid_items_SuperSpecific = array('6471', '14995');
         //超规格的产品,长度大于60cm, 三边大于 90cm
         $__liquid_items_Paste = array_filter(explode(",", $__liquid_items_array['膏状产品']));
         //膏状SKU*/
         $__liquid_items_elecWithoutBattery = array_filter(explode(",", $__liquid_items_array['电子类【不带电池】']));
         //电子类【不带电池】*/
         $__liquid_items_OutWeight = array_filter(explode(",", $__liquid_items_array['超重产品>=1.9kg']));
         //超重产品>=1.9kg*/
         //取统一包装材料重量数据
         //$MaterInfo = CommonModel::getMaterInfo();
         //取统一国家中文名对应英文名
         /*$ec = "select * from ebay_countrys where ebay_user='$user' ";
         		$result = $dbConn->execute($ec);
         		$ebay_country_lists = $dbConn->getResultArray($result);
         		$global_countrycn_coutryen = array();
         		foreach($ebay_country_lists AS $ebay_country_list){
         			$global_countrycn_coutryen[trim($ebay_country_list['countryen'])] = trim($ebay_country_list['countrycn']);
         		}*/
         //取各个平台的账号名称
         $SYSTEM_ACCOUNTS = OmAvailableModel::getPlatformAccount();
         //echo "<pre>";print_r($SYSTEM_ACCOUNTS);
         $express_delivery = array();
         $express_delivery_value = array();
         $no_express_delivery = array();
         $no_express_delivery_value = array();
         $express_delivery_value = CommonModel::getCarrierListById(1);
         /*foreach($express_delivery_arr as $value){
         			$express_delivery_value[$value['id']] = $value['carrierNameCn'];
         		}*/
         $express_delivery = array_keys($express_delivery_value);
         //var_dump($express_delivery);
         $no_express_delivery_value = CommonModel::getCarrierListById(0);
         /*foreach($no_express_delivery_arr as $value){
         			$no_express_delivery_value[$value['id']] = $value['carrierNameCn'];
         		}*/
         $no_express_delivery = array_keys($no_express_delivery_value);
     }
     if (!$GLOBAL_EBAY_ACCOUNT) {
         $GLOBAL_EBAY_ACCOUNT = array();
         foreach ($SYSTEM_ACCOUNTS as $acct) {
             foreach ($acct as $key => $value) {
                 $GLOBAL_EBAY_ACCOUNT[$key] = $value;
             }
         }
     }
     //var_dump($GLOBAL_EBAY_ACCOUNT);exit;
     self::initDB();
     //var_dump($orderData); echo "\n";
     $log_data = "";
     $actualTotal0 = 0;
     //该订单实际总数
     //$ebay_id = $orderData['orderData']['id'];
     $orderStatus = empty($orderData['orderData']['orderStatus']) ? C('STATEPENDING') : $orderData['orderData']['orderStatus'];
     $orderType = empty($orderData['orderData']['orderType']) ? C('STATEPENDING_CONV') : $orderData['orderData']['orderType'];
     $returnStatus = array('orderStatus' => $orderStatus, 'orderType' => $orderType);
     $isNote = $orderData['orderData']['isNote'];
     if ($isNote) {
         $orderType = C('STATEPENDING_MSG');
     }
     $calcWeight = $orderData['orderData']['calcWeight'];
     $pmId = $orderData['orderData']['pmId'];
     //var_dump($calcWeight); echo "\n";
     $orderdetaillist = $orderData['orderDetail'];
     if (empty($calcWeight)) {
         $calcInfo = CommonModel::calcAddOrderWeight($orderdetaillist);
         //计算重量和包材
         $calcWeight = $calcInfo[0];
         $pmId = $calcInfo[1];
         $orderData['orderData']['calcWeight'] = $calcWeight;
         $orderData['orderData']['pmId'] = $pmId;
     }
     //var_dump($calcWeight); echo "\n";
     $transportId = @$orderData['orderData']['transportId'];
     $countryName = $orderData['orderUserInfoData']['countryName'];
     $accountId = $orderData['orderData']['accountId'];
     $actualTotal = $orderData['orderData']['actualTotal'];
     $ebay_username = $orderData['orderUserInfoData']['username'];
     $orderDataid = $orderData['orderExtenData']['orderId'];
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:cndl.model.php

示例3: act_addDistributorOrder


//.........这里部分代码省略.........
         //
         $orderExtAli['declaredPrice'] = $val['orderAmount']['amount'];
         $orderExtAli['paymentStatus'] = "";
         //$order['fundStatus'];
         $orderExtAli['transId'] = "";
         //$val['tradeID'];//$order['id'];//$orderdetail["id"]; // 交易id;;
         //$orderExtAli[PayPalPaymentId"]	=	'';
         //$orderExtAli["site"]			    =	'';
         $orderExtAli['orderId'] = $val['orderId'];
         $orderExtAli['platformUsername'] = "";
         //$order['buyerSignerFullname'];;
         $orderExtAli['currency'] = $val['orderAmount']['currencyCode'];
         $orderExtAli['PayPalEmailAddress'] = "";
         //$order['buyerInfo']['email'];;
         $orderExtAli['eBayPaymentStatus'] = "";
         //1?//$order['orderStatus']; //订单状态;
         /***************END 订单扩展表数据***************/
         /***************BEGIN 订单用户表数据***************/
         $orderUserInfo = array();
         $orderUserInfo['username'] = $val['receiptAddress']['contactPerson'];
         $orderUserInfo['platformUsername'] = "";
         //$order['buyerSignerFullname'];
         $orderUserInfo['email'] = "";
         //$order['buyerInfo']['email'];
         $orderUserInfo['countryName'] = get_country_name($val['receiptAddress']['country']);
         $orderUserInfo['countrySn'] = $val['receiptAddress']['country'];
         $orderUserInfo['currency'] = $val['orderAmount']['currencyCode'];
         $orderUserInfo['state'] = $val['receiptAddress']['province'];
         $orderUserInfo['city'] = $val['receiptAddress']['city'];
         $orderUserInfo['street'] = $val['receiptAddress']['address1'];
         //?//$val['receiptAddress']['detailAddress'];
         $orderUserInfo['address2'] = isset($val['receiptAddress']['address2']) ? $val['receiptAddress']['address2'] : "";
         $orderUserInfo['zipCode'] = $val['receiptAddress']['zip'];
         $orderUserInfo['phone'] = $val['receiptAddress']['phoneNumber'];
         /*************END 订单用户表数据***************/
         $carrier = array();
         $item_notes = array();
         $noteb = array();
         $insertOrder = array('orderData' => $orderdata, 'orderExtenData' => $orderExtAli, 'orderUserInfoData' => $orderUserInfo);
         $orderweight = "";
         $obj_order_detail_data = array();
         foreach ($val['childOrderList'] as $orderdetail) {
             //明细表
             $orderdata_detail = array();
             //$orderdata_detail['omOrderId']	    =	$insertId;//$order["id"];
             $orderdata_detail['recordNumber'] = $orderId;
             $orderdata_detail['sku'] = $orderdetail['productAttributes']['sku'];
             //substr($orderdetail['skuCode'],0,stripos($orderdetail['skuCode'],'#'));
             $orderdata_detail['itemPrice'] = $orderdetail['productAttributes']['itemPrice'];
             $orderdata_detail['amount'] = $orderdetail['lotNum'];
             //$orderdata_detail["shippingFee"]	=	'';
             //$orderdata_detail["reviews"]	    =	'';
             $orderdata_detail['createdTime'] = time();
             //明细扩展表
             $orderDetailExtAli = array();
             $orderDetailExtAli['itemTitle'] = $orderdetail['productAttributes']['itemTitle'];
             $orderDetailExtAli['itemURL'] = $orderdetail['productAttributes']['skuUrl'];
             $orderDetailExtAli['itemId'] = "";
             //$orderdetail['productId'];
             $orderDetailExtAli['transId'] = 0;
             //$orderId;//$orderdetail['orderId']; // 交易id;
             $orderDetailExtAli['note'] = "";
             //$item_notes[$orderdetail['orderId']];
             $obj_order_detail_data[] = array('orderDetailData' => $orderdata_detail, 'orderDetailExtenData' => $orderDetailExtAli);
         }
         $insertOrder['orderDetail'] = $obj_order_detail_data;
         $calcInfo = CommonModel::calcAddOrderWeight($obj_order_detail_data);
         //计算重量和包材
         $insertOrder['orderData']['calcWeight'] = $calcInfo[0];
         $insertOrder['orderData']['pmId'] = $calcInfo[1];
         if (count($insertOrder['orderDetail']) > 1) {
             $insertOrder['orderData']['orderAttribute'] = 3;
         } else {
             if (isset($insertOrder['orderDetail'][0]['orderDetailData']['amount']) && $insertOrder['orderDetail'][0]['orderDetailData']['amount'] > 1) {
                 $insertOrder['orderData']['orderAttribute'] = 2;
             }
         }
         $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, 1);
         //计算运费
         $insertOrder['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
         $insertOrder = AutoModel::auto_contrast_intercept($insertOrder);
         $opflag = "false";
         if (OrderAddModel::insertAllOrderRow($insertOrder)) {
             $itemRtn["errcode"] = 0;
             $itemRtn["orderId"] = $orderId;
             $itemRtn["msg"] = "success";
             $rtnArr[] = $itemRtn;
             $opflag = "success";
         } else {
             $itemRtn["errcode"] = 80005;
             $itemRtn["orderId"] = $orderId;
             $itemRtn["msg"] = "添加订单失败";
             $rtnArr[] = $itemRtn;
         }
         $logfile = date("Y-m-d") . ".log";
         @file_put_contents("/home/ebay_order_cronjob_logs/auto_contrast_intercept/" . $account . "/" . $logfile, $_POST["orderArr"] . "==" . $opflag . "\r\n", FILE_APPEND);
     }
     $rtnStr = json_encode($rtnArr);
     echo $rtnStr;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:openSystemApi.action.php

示例4: __handle_ebay_orderxml


//.........这里部分代码省略.........
                     //$ListingType 		= @$odItem->getElementsByTagName('ListingType')->item(0)->nodeValue;
                     $CategoryID = 0;
                     $ListingType = '';
                     //购买数量
                     $QuantityPurchased = $transaction->getElementsByTagName('QuantityPurchased')->item(0)->nodeValue;
                     //交易创建时间
                     $CreatedDate = strtotime($transaction->getElementsByTagName('CreatedDate')->item(0)->nodeValue);
                     $FinalValueFee = $transaction->getElementsByTagName('FinalValueFee')->item(0)->nodeValue;
                     $tran_price = $transaction->getElementsByTagName('TransactionPrice')->item(0)->nodeValue;
                     $goodsshippingcost = $transaction->getElementsByTagName('ActualShippingCost')->item(0)->nodeValue;
                     $goodsshippingcost = empty($goodsshippingcost) ? '0.0' : $goodsshippingcost;
                     $tran_itemid = $odItem->getElementsByTagName('ItemID')->item(0)->nodeValue;
                     $tran_site = $odItem->getElementsByTagName('Site')->item(0)->nodeValue;
                     //$obj_order_detail	=new eBayOrderDetail();
                     $obj_order_detail_data[] = array('orderDetailData' => array('recordNumber' => $tran_recordnumber, 'itemPrice' => $tran_price, 'sku' => strtoupper($odSKU), 'amount' => $QuantityPurchased, 'shippingFee' => $goodsshippingcost, 'createdTime' => $mctime), 'orderDetailExtenData' => array('itemId' => $tran_itemid, 'transId' => $tran_id, 'itemTitle' => $odItemTitle, 'itemURL' => '', 'shippingType' => $oShipingService, 'FinalValueFee' => $FinalValueFee, 'FeeOrCreditAmount' => $oFeeOrCreditAmount, 'ListingType' => $ListingType, 'note' => $oBuyerCheckoutMessage));
                 }
                 $orderData['orderDetail'] = $obj_order_detail_data;
                 $rtn = OldsystemModel::orderErpInsertorder($orderData);
                 //var_dump($rtn);
                 $insertData = array();
                 if ($rtn['errcode'] == 200) {
                     var_dump($rtn);
                     $rtn_data = $rtn['data'];
                     $orderId = $rtn_data['orderId'];
                     echo "插入老系统成功,订单编号 [{$orderId}] \n";
                     $pmId = $rtn_data['pmId'];
                     $totalweight = $rtn_data['totalweight'];
                     $shipfee = $rtn_data['shipfee'];
                     $carrier = $rtn_data['carrier'];
                     $carrierId = $rtn_data['carrierId'];
                     $status = $rtn_data['status'];
                     $orderData['orderData']['id'] = $orderId;
                     //赋予新系统订单编号@20140501
                     $calcInfo = CommonModel::calcAddOrderWeight($obj_order_detail_data);
                     //计算重量和包材
                     //var_dump($calcInfo);
                     $orderData['orderData']['ORcalcWeight'] = $calcInfo[0];
                     $orderData['orderData']['calcWeight'] = $calcInfo[0];
                     $orderData['orderData']['pmId'] = $calcInfo[1];
                     if ($orderData['orderData']['calcWeight'] != $totalweight) {
                         $insertData['old_totalweight'] = $totalweight;
                         $insertData['new_totalweight'] = $orderData['orderData']['calcWeight'];
                     }
                     if ($orderData['orderData']['pmId'] != $pmId) {
                         $insertData['old_pmId'] = $pmId;
                         $insertData['new_pmId'] = $orderData['orderData']['pmId'];
                     }
                     if (count($orderData['orderDetail']) > 1) {
                         $orderData['orderData']['orderAttribute'] = 3;
                     } else {
                         if (isset($orderData['orderDetail'][0]['orderDetailData']['amount']) && $orderData['orderDetail'][0]['orderDetailData']['amount'] > 1) {
                             $orderData['orderData']['orderAttribute'] = 2;
                         }
                     }
                     $calcShippingInfo = TransAPIModel::trans_carriers_best_get($orderData['orderData']['calcWeight'], $orderData['orderUserInfoData']['countryName'], $ebay_account, $orderData['orderData']['actualTotal']);
                     //计算运费
                     //var_dump($calcShippingInfo);
                     $orderData['orderData']['calcShipping'] = $calcShippingInfo['fee'];
                     $orderData['orderData']['transportId'] = $calcShippingInfo['carrierId'];
                     $orderData['orderData']['ORtransportId'] = $calcShippingInfo['carrierId'];
                     $orderData['orderData']['channelId'] = $calcShippingInfo['channelId'];
                     $orderData['orderData']['ORchannelId'] = $calcShippingInfo['channelId'];
                     if ($orderData['orderData']['calcShipping'] != $shipfee) {
                         $insertData['old_shippfee'] = $shipfee;
                         $insertData['new_shippfee'] = $orderData['orderData']['calcShipping'];
                     }
开发者ID:ohjack,项目名称:newErp,代码行数:67,代码来源:GetCertainOrder.php

示例5: act_recalculated_bak

 public function act_recalculated_bak()
 {
     $orderId = isset($_REQUEST['orderid']) ? $_REQUEST['orderid'] : '';
     if (empty($orderId)) {
         self::$errCode = "006";
         self::$errMsg = "订单号错误!";
         return false;
     }
     $tNameUnShipped = 'om_unshipped_order';
     //未發貨订单表
     $where = ' WHERE id = "' . $orderId . '" ';
     $shipOrderList = OrderindexModel::showOrderList($tNameUnShipped, $where);
     $shipOrderList = isset($shipOrderList[$orderId]) ? $shipOrderList[$orderId] : '';
     if (empty($shipOrderList)) {
         self::$errCode = "007";
         self::$errMsg = "查询数据出错!";
         return false;
     }
     $orderDetail = $shipOrderList['orderDetail'];
     $obj_order_detail_data = array();
     foreach ($orderDetail as $k => $v) {
         $orderdata_detail = array();
         $orderdata_detail['recordNumber'] = $v['orderDetailData']['recordNumber'];
         $orderdata_detail['sku'] = $v['orderDetailData']['sku'];
         $orderdata_detail['itemPrice'] = $v['orderDetailData']['itemPrice'];
         $orderdata_detail['amount'] = $v['orderDetailData']['amount'];
         $orderdata_detail['createdTime'] = time();
         $orderDetailExtAli = array();
         $orderDetailExtAli['itemTitle'] = $v['orderDetailExtenData']['itemTitle'];
         $orderDetailExtAli['itemURL'] = $v['orderDetailExtenData']['itemURL'];
         $orderDetailExtAli['itemId'] = $v['orderDetailExtenData']['itemId'];
         $orderDetailExtAli['transId'] = $v['orderDetailExtenData']['transId'];
         $orderDetailExtAli['note'] = $v['orderDetailExtenData']['note'];
         $obj_order_detail_data[] = array('orderDetailData' => $orderdata_detail, 'orderDetailExtenData' => $orderDetailExtAli);
     }
     $calcInfo = CommonModel::calcAddOrderWeight($obj_order_detail_data);
     //计算重量和包材
     if (isset($calcInfo[0])) {
         return $calcInfo[0];
     } else {
         self::$errCode = "008";
         self::$errMsg = "计算数据出错!";
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:45,代码来源:orderModify.action.php

示例6: overWeightSplitB2B


//.........这里部分代码省略.........
         $totalweight = 0;
         $insert_ebay_ids = array();
         //var_dump($skuinfo); echo "<br>";
         foreach ($keyarray as $k => $kav) {
             //var_dump($skuinfo[$k]['orderDetailData']['itemPrice'], count($kav));
             //$ebay_total += ($skuinfo[$k]['orderDetailData']['itemPrice'] + $shippfee_arr[$k]) * count($kav);
             $ebay_total += $skuinfo[$k]['orderDetailData']['itemPrice'] * count($kav);
         }
         $ebay_total = $rate * $ebay_total;
         $shipfee = 0;
         //$val = generateOrdersn();
         $insert_obj_order_data = $obj_order_data;
         unset($insert_obj_order_data['id']);
         $insert_obj_order_data['actualTotal'] = $ebay_total;
         $insert_obj_order_data['orderType'] = C('STATEPENDING_OWDONE');
         $insert_obj_order_data['orderAddTime'] = $mctime;
         $insert_obj_order_data['isSplit'] = 2;
         $insert_orderExtenData = $orderExtenData;
         unset($insert_orderExtenData['id']);
         $insert_orderUserInfoData = $orderUserInfoData;
         unset($insert_orderUserInfoData['id']);
         $insert_orderData = array('orderData' => $insert_obj_order_data, 'orderExtenData' => $insert_orderExtenData, 'orderUserInfoData' => $insert_orderUserInfoData);
         /*$sql = "insert into ebay_splitorder (recordnumber, main_order_id, split_order_id, create_date) values ('$recordnumber', '$ebay_id', '$insert_ebay_id', '".date("Y-m-d H:i:s")."')";
         		$split_log .= "添加主定单和拆分订单到关系表中\r\n".$sql ."\r\n";
         		$dbcon->execute($sql) or die("Fail : $sql");*/
         $obj_order_detail_data = array();
         foreach ($keyarray as $k => $kav) {
             $sku = $k;
             $amount = count($kav);
             $insert_orderDetailData = $skuinfo[$k]['orderDetailData'];
             unset($insert_orderDetailData['id']);
             $insert_orderDetailData['sku'] = strtoupper($sku);
             $insert_orderDetailData['amount'] = $amount;
             $insert_orderDetailData['createdTime'] = $mctime;
             if (isset($shippfee_arr[$sku])) {
                 $insert_orderDetailData['shippingFee'] = $shippfee_arr[$sku] * $amount;
                 //相同料号运费拆分
             }
             $insert_orderDetailExtenData = $skuinfo[$k]['orderDetailExtenData'];
             unset($insert_orderDetailExtenData['id']);
             $obj_order_detail_data[] = array('orderDetailData' => $insert_orderDetailData, 'orderDetailExtenData' => $insert_orderDetailExtenData);
         }
         $insert_orderData['orderDetail'] = $obj_order_detail_data;
         //echo "<pre>";
         //var_dump($obj_order_detail_data); exit;
         $calcInfo = CommonModel::calcAddOrderWeight($obj_order_detail_data);
         //计算重量和包材
         //var_dump($calcInfo); exit;
         $insert_orderData['orderData']['calcWeight'] = $calcInfo[0];
         $insert_orderData['orderData']['pmId'] = $calcInfo[1];
         //var_dump($insert_orderData); exit;
         $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insert_orderData, 1);
         //计算运费
         //var_dump($calcShippingInfo); exit;
         $insert_orderData['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
         $insert_orderData['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
         /*$interceptInfo = CommonModel :: auto_contrast_intercept($orderData);
         		//print_r($interceptInfo); exit;
         		$orderData['orderData']['orderStatus'] = $interceptInfo['orderStatus'];
         		$orderData['orderData']['orderType'] = $interceptInfo['orderType'];*/
         if ($_spitId = OrderAddModel::insertAllOrderRowNoEvent($insert_orderData)) {
             //echo $split_log .= 'insert success!' . "\n"; exit;
             //var_dump($_mainId,$_spitId); exit;
             if (!OrderLogModel::insertOrderLog($_spitId, 'INSERT ORDER')) {
                 BaseModel::rollback();
                 self::$errCode = '0021';
                 self::$errMsg = "split error!";
                 return false;
             }
             if (!OrderRecordModel::insertSpitRecords($_mainId, $_spitId)) {
                 BaseModel::rollback();
                 self::$errCode = '0022';
                 self::$errMsg = "split error!";
                 return false;
             }
         } else {
             $split_log .= 'insert error!' . "\n";
             BaseModel::rollback();
             self::$errCode = '0023';
             self::$errMsg = "split error!";
             return false;
         }
         if (!OrderindexModel::deleteOrderData($tableName, $where)) {
             self::$errCode = '0024';
             self::$errMsg = "split error!";
             return false;
         }
         if (!OrderLogModel::insertOrderLog($_mainId, 'DELETE ORDER')) {
             BaseModel::rollback();
             self::$errCode = '0025';
             self::$errMsg = "split error!";
             return false;
         }
         BaseModel::commit();
         BaseModel::autoCommit();
     }
     self::$errCode = '200';
     self::$errMsg = "split success!";
     return true;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:splitOrder.model.php

示例7: act_invokeListOrders


//.........这里部分代码省略.........
                     //amazon的账号ID
                     //echo ("accountId ==== ");
                     //echo ($orderData['accountId'] . "\n");
                     $orderData['orderAddTime'] = time();
                     //添加到系统的时间
                     //echo ("orderAddTime ==== ");
                     //echo ($orderData['orderAddTime'] . "\n");
                     $orderData['orderStatus'] = C('STATEPENDING');
                     //默认订单状态
                     $orderData['orderType'] = C('STATEPENDING_INITIAL');
                     //默认订单类型
                     $orderData = array('orderData' => $orderData, 'orderExtenData' => $orderExtenData, 'orderUserInfoData' => $orderUserInfoData);
                     $tName = 'om_unshipped_order';
                     $where = "WHERE recordNumber='{$orderData['orderData']['recordNumber']}' AND platformId={$orderData['orderData']['platformId']} and is_delete ='0'";
                     $flagCountUnshipped = OmAvailableModel::getTNameCount($tName, $where);
                     $tName = 'om_shipped_order';
                     $flagCountshipped = OmAvailableModel::getTNameCount($tName, $where);
                     if (empty($flagCountUnshipped) && empty($flagCountshipped)) {
                         //判断订单是否已经在系统2个订单表(未发货和已发货)中存在
                         //$orderData['ebay_ordersn']	=	generateOrdersn();
                         $detailrequest = new MarketplaceWebServiceOrders_Model_ListOrderItemsRequest();
                         $detailrequest->setSellerId(MERCHANT_ID);
                         $detailrequest->setAmazonOrderId($orderData['orderData']['recordNumber']);
                         $orderDetailArr = self::act_invokeListOrderItems($service, $detailrequest);
                         //var_dump($orderDetailArr); exit;
                         for ($i = 0; $i < count($orderDetailArr); $i++) {
                             $orderDetailArr[$i]['orderDetailData']['recordNumber'] = $orderData['orderData']['recordNumber'];
                         }
                         //print_r($orderDetailArr);
                         if (!empty($orderDetailArr)) {
                             $orderData['orderDetail'] = $orderDetailArr;
                             $insertData = array();
                             //var_dump($obj_order_detail_data); echo "<br>";
                             $calcInfo = CommonModel::calcAddOrderWeight($orderDetailArr);
                             //计算重量和包材
                             //var_dump($calcInfo); exit;
                             $orderData['orderData']['ORcalcWeight'] = $calcInfo[0];
                             $orderData['orderData']['calcWeight'] = $calcInfo[0];
                             $orderData['orderData']['pmId'] = $calcInfo[1];
                             if ($orderData['orderData']['calcWeight'] != $totalweight) {
                                 $insertData['old_totalweight'] = $totalweight;
                                 $insertData['new_totalweight'] = $orderData['orderData']['calcWeight'];
                             }
                             if ($orderData['orderData']['pmId'] != $pmId) {
                                 $insertData['old_pmId'] = $pmId;
                                 $insertData['new_pmId'] = $orderData['orderData']['pmId'];
                             }
                             $newcarrier = get_carrier($orderData['orderData']['calcWeight'], $orderData['orderUserInfoData']['countryName'], $account, $orderData['orderUserInfoData']['currency']);
                             $orderData['orderData']['transportId'] = $flip_transportList[$newcarrier];
                             $orderData['orderData']['ORtransportId'] = $flip_transportList[$newcarrier];
                             $rtn = OldsystemModel::orderErpInsertorder($orderData);
                             //var_dump($rtn);
                             if ($rtn['errcode'] == 200) {
                                 //var_dump($rtn);
                                 $rtn_data = $rtn['data'];
                                 $orderId = $rtn_data['orderId'];
                                 $message .= "<font color='green'>" . date("Y-m-d H:i:s") . " 插入老系统成功,订单编号 [{$orderId}] </font><br>";
                                 $pmId = $rtn_data['pmId'];
                                 $totalweight = $rtn_data['totalweight'];
                                 $shipfee = $rtn_data['shipfee'];
                                 $carrier = $rtn_data['carrier'];
                                 $carrierId = $rtn_data['carrierId'];
                                 $status = $rtn_data['status'];
                                 $orderData['orderData']['id'] = $orderId;
                                 //赋予新系统订单编号@20140501
                                 if (count($orderData['orderDetail']) > 1) {
开发者ID:ohjack,项目名称:newErp,代码行数:67,代码来源:fetchAmazonOrder.action.php

示例8: act_transportFee

 public function act_transportFee()
 {
     $omOrderId = $_POST['id'];
     $tableName = 'om_unshipped_order';
     $where = ' WHERE id = ' . $omOrderId;
     $orderList = OrderindexModel::showOrderList($tableName, $where);
     $orderData = $orderList[$omOrderId];
     $data = array();
     //print_r($orderData);
     $obj_order_detail_data = array();
     foreach ($orderData['orderDetail'] as $sku => $detail) {
         $obj_order_detail_data[] = $detail['orderDetailData'];
     }
     $weightfee = commonModel::calcOrderWeight($obj_order_detail_data);
     $data['calcWeight'] = $weightfee[0];
     $calcShippingInfo = CommonModel::calcAddOrderShippingFee($orderData, 1);
     //计算运费
     //var_dump($calcShippingInfo); exit;
     $calcInfo = CommonModel::calcAddOrderWeight($orderData['orderDetail']);
     //计算重量和包材
     //var_dump($calcInfo); exit;
     $data['calcWeight'] = $calcInfo[0];
     $data['pmId'] = $calcInfo[1];
     $data['calcShipping'] = $calcShippingInfo['fee']['fee'];
     $data['channelId'] = $calcShippingInfo['fee']['channelId'];
     if (OrderindexModel::updateOrder($tableName, $data, $where)) {
         self::$errCode = OrderindexModel::$errCode;
         self::$errMsg = OrderindexModel::$errMsg;
         return true;
     } else {
         self::$errCode = OrderindexModel::$errCode;
         self::$errMsg = OrderindexModel::$errMsg;
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:35,代码来源:orderindex.action.php

示例9: auto_contrast_intercept

 public static function auto_contrast_intercept($orderData)
 {
     global $SYSTEM_ACCOUNTS, $__liquid_items_fenmocsku, $__liquid_items_BuiltinBattery, $__liquid_items_SuperSpecific, $__liquid_items_Paste;
     global $GLOBAL_EBAY_ACCOUNT;
     global $express_delivery, $no_express_delivery;
     if (!$SYSTEM_ACCOUNTS) {
         if (!defined('WEB_PATH')) {
             define("WEB_PATH", "/data/web/order.valsun.cn/");
             //define("WEB_PATH","/data/web/framework.valsun.cn/");
         }
         include WEB_PATH . "conf/scripts/script.ebay.config.php";
     }
     if (!$GLOBAL_EBAY_ACCOUNT) {
         $GLOBAL_EBAY_ACCOUNT = array();
         foreach ($SYSTEM_ACCOUNTS as $acct) {
             foreach ($acct as $key => $value) {
                 $GLOBAL_EBAY_ACCOUNT[$key] = $value;
             }
         }
     }
     //var_dump($GLOBAL_EBAY_ACCOUNT);
     self::initDB();
     //var_dump($orderData); echo "\n";
     $log_data = "";
     $actualTotal0 = 0;
     //该订单实际总数
     //$ebay_id = $orderData['orderData']['id'];
     $orderStatus = empty($orderData['orderData']['orderStatus']) ? C('STATEPENDING') : $orderData['orderData']['orderStatus'];
     $orderType = empty($orderData['orderData']['orderType']) ? C('STATEPENDING_CONV') : $orderData['orderData']['orderType'];
     $returnStatus = array('orderStatus' => $orderStatus, 'orderType' => $orderType);
     $isNote = $orderData['orderData']['isNote'];
     if ($isNote) {
         $orderType = C('STATEPENDING_MSG');
     }
     $calcWeight = $orderData['orderData']['calcWeight'];
     $pmId = $orderData['orderData']['pmId'];
     //var_dump($calcWeight); echo "\n";
     $orderdetaillist = $orderData['orderDetail'];
     if (empty($calcWeight)) {
         $calcInfo = CommonModel::calcAddOrderWeight($orderdetaillist);
         //计算重量和包材
         $calcWeight = $calcInfo[0];
         $pmId = $calcInfo[1];
         $orderData['orderData']['calcWeight'] = $calcWeight;
         $orderData['orderData']['pmId'] = $pmId;
     }
     //var_dump($calcWeight); echo "\n";
     $transportId = @$orderData['orderData']['transportId'];
     $countryName = $orderData['orderUserInfoData']['countryName'];
     $accountId = $orderData['orderData']['accountId'];
     $actualTotal = $orderData['orderData']['actualTotal'];
     $ebay_username = $orderData['orderUserInfoData']['username'];
     $orderDataid = $orderData['orderExtenData']['orderId'];
     $ebay_usermail = $orderData['orderUserInfoData']['email'];
     $PayPalEmailAddress = @$orderData['orderExtenData']['PayPalEmailAddress'];
     //echo "------$countryName-----\n";
     //echo "订单计算重量:$calcWeight\t\n";
     $contain_special_item = false;
     $contain_os_item = false;
     $ow_status = array();
     $all_splited_sku = array();
     //汇总改订单的sku
     //foreach ($orderdetaillist AS $orderdetail){
     for ($i = 0; $i < count($orderdetaillist); $i++) {
         $sku = $orderdetaillist[$i]['orderDetailData']['sku'];
         $itemPrice = $orderdetaillist[$i]['orderDetailData']['itemPrice'];
         $amount = $orderdetaillist[$i]['orderDetailData']['amount'];
         $shippingFee = $orderdetaillist[$i]['orderDetailData']['shippingFee'];
         //var_dump($sku);
         $sku_arr = GoodsModel::get_realskuinfo($sku);
         //将sku的信息汇总到汇总sku列表中
         foreach ($sku_arr as $f_sku => $f_num) {
             if (array_key_exists($f_sku, $all_splited_sku)) {
                 $all_splited_sku[$f_sku] = $all_splited_sku[$f_sku] + $f_num;
             } else {
                 $all_splited_sku[$f_sku] = $f_num;
             }
         }
         //var_dump($sku_arr); exit;
         $actualTotal0 += $itemPrice * $amount + $shippingFee;
         foreach ($sku_arr as $or_sku => $or_nums) {
             if (in_array($or_sku, $__liquid_items_fenmocsku) || in_array($or_sku, $__liquid_items_SuperSpecific) || in_array($or_sku, $__liquid_items_BuiltinBattery)) {
                 //粉末状,超规格产品 走福建邮局
                 $contain_special_item = true;
             }
             if (preg_match("/^US01\\+.*/", $or_sku, $matchArr) || preg_match("/^US1\\+.*/", $or_sku, $matchArr)) {
                 //$log_data .= "[".date("Y-m-d H:i:s")."]\t包含海外仓料号订单---{$ebay_id}-----料号:{$or_sku}--!\n\n";
                 $contain_os_item = true;
                 if (strpos($or_sku, "US01+") !== false) {
                     $matchStr = substr($matchArr[0], 5);
                     //去除前面
                     //$matchStr = str_replace("US1+", "", $or_sku);
                 } else {
                     //$matchStr=substr($matchArr[0],5);//去除前面
                     $matchStr = str_replace("US1+", "", $or_sku);
                 }
                 $n = strpos($matchStr, ':');
                 //寻找位置
                 if ($n) {
                     $matchStr = substr($matchStr, 0, $n);
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:auto.model.php

示例10: round_num

     $orderDetailExtTaobao['transId'] = $recordnumber;
     // 交易id;
     $orderDetailExtTaobao['note'] = round_num($order['payment'], 2);
     //实际SKU付款价
     /*************END 订单详细扩展表数据***************/
     $obj_order_detail_data[] = array('orderDetailData' => $orderdata_detail, 'orderDetailExtenData' => $orderDetailExtTaobao);
 }
 //包含HH555料号的订单移动到淘宝待审核
 if (in_array('HH555', $sku_infos)) {
     $orderdata['orderType'] = C('STATEPENDING_LYNXPEND');
 }
 $insertOrder = array('orderData' => $orderdata, 'orderExtenData' => $orderExtTaobao, 'orderUserInfoData' => $orderUserInfo);
 //var_dump($obj_order_detail_data); exit;
 $insertOrder['orderDetail'] = $obj_order_detail_data;
 //var_dump($obj_order_detail_data); echo "<br>";
 $calcInfo = CommonModel::calcAddOrderWeight($obj_order_detail_data);
 //计算重量和包材
 //var_dump($calcInfo); exit;
 $insertOrder['orderData']['calcWeight'] = $calcInfo[0];
 $insertOrder['orderData']['pmId'] = $calcInfo[1];
 if (count($insertOrder['orderDetail']) > 1) {
     $insertOrder['orderData']['orderAttribute'] = 3;
 } else {
     if (isset($insertOrder['orderDetail'][0]['orderDetailData']['amount']) && $insertOrder['orderDetail'][0]['orderDetailData']['amount'] > 1) {
         $insertOrder['orderData']['orderAttribute'] = 2;
     }
 }
 $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, 1);
 //计算运费
 //var_dump($calcShippingInfo); exit;
 //$insert_orderData['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
开发者ID:ohjack,项目名称:newErp,代码行数:31,代码来源:sync.taobao.order.php

示例11: act_operateAbOrderAPI

 public function act_operateAbOrderAPI()
 {
     if (!isset($_POST['omData'])) {
         self::$errCode = 500;
         self::$errMsg = '未成功接收数据!';
         return false;
     }
     $ostatus = 770;
     $otype = 0;
     $storeId = 1;
     $orderstr = $_POST['omData'];
     $orderstr2 = $_POST['omData2'];
     $orderids = array_unique(explode(',', $orderstr));
     $invoiceids = array_unique(explode(',', $orderstr2));
     if (!$orderids) {
         self::$errCode = 400;
         self::$errMsg = '未获取订单编号信息!';
         return false;
     }
     //var_dump($orderids); exit;
     $OrderindexAct = new OrderindexAct();
     $WarehouseAPIAct = new WarehouseAPIAct();
     foreach ($orderids as $k => $orderId) {
         BaseModel::begin();
         //开始事务
         $insertOrderData = array();
         $AbOrderInfo = $WarehouseAPIAct->act_getAbOrderInfo($invoiceids[$k]);
         //var_dump($AbOrderInfo); echo "<br>";
         //exit;
         $where = ' WHERE id = ' . $orderId . ' and is_delete = 0 AND storeId = ' . $storeId . ' LIMIT 1';
         $orderList = $OrderindexAct->act_showOrderList($ostatus, $otype, $where);
         //var_dump($orderList);exit;
         $order = $orderList[$orderId];
         $orderData = $order['orderData'];
         $insert_orderData = $orderData;
         unset($insert_orderData['id']);
         $insert_orderData['orderStatus'] = C('STATEOUTOFSTOCK');
         $insert_orderData['orderType'] = C('STATEOUTOFSTOCK_ABNORMAL');
         $orderExtenData = $order['orderExtenData'];
         $insert_orderExtenData = $orderExtenData;
         unset($insert_orderExtenData['omOrderId']);
         $orderUserInfoData = $order['orderUserInfoData'];
         $insert_orderUserInfoData = $orderUserInfoData;
         unset($insert_orderUserInfoData['omOrderId']);
         //$orderTracknumber = $order['orderTracknumber'];
         //$orderAudit = $order['orderAudit'];
         $orderDetail = $order['orderDetail'];
         $insertOrderData['orderData'] = $insert_orderData;
         $insertOrderData['orderExtenData'] = $insert_orderExtenData;
         $insertOrderData['orderUserInfoData'] = $insert_orderUserInfoData;
         $insert_orderDetail = array();
         $need_delete_ids = array();
         foreach ($orderDetail as $dkey => $detailValue) {
             $orderDetailData = $detailValue['orderDetailData'];
             $orderDetailExtenData = $detailValue['orderDetailExtenData'];
             if (!isset($AbOrderInfo[$orderDetailData['sku']]) || $AbOrderInfo[$orderDetailData['sku']] == 0) {
                 $insert_orderDetailData = $orderDetailData;
                 unset($insert_orderDetailData['id']);
                 unset($insert_orderDetailData['omOrderId']);
                 $insert_orderDetailExtenData = $orderDetailExtenData;
                 unset($insert_orderDetailExtenData['omOrderdetailId']);
                 $insert_orderDetail[$dkey]['orderDetailData'] = $insert_orderDetailData;
                 $insert_orderDetail[$dkey]['orderDetailExtenData'] = $insert_orderDetailExtenData;
                 $need_delete_ids[] = $orderDetailData['id'];
             }
         }
         $insertOrderData['orderDetail'] = $insert_orderDetail;
         $count_insert_orderDetail = count($insert_orderDetail);
         $count_orderDetail = count($orderDetail);
         $tableName = "om_unshipped_order";
         if ($count_insert_orderDetail > 0 && $count_insert_orderDetail < $count_orderDetail) {
             $calcWeight = CommonModel::calcNowOrderWeight($orderId);
             //重新计算原来订单的重量
             if (!OrderindexModel::deleteOrderDetail(array('is_delete' => 1), ' where id in(' . join(',', $need_delete_ids) . ')')) {
                 BaseModel::rollback();
                 self::$errCode = '005';
                 self::$errMsg = "删除原订单明细失败!";
                 return false;
             }
             $insertOrderData['orderData']['isCopy'] = 2;
             $insertOrderData['orderData']['actualTotal'] = 0.0;
             //var_dump($orderData);exit;
             $calcInfo = CommonModel::calcAddOrderWeight($insert_orderDetail);
             //计算重量和包材
             //var_dump($calcInfo); exit;
             $insertOrderData['orderData']['calcWeight'] = $calcInfo[0];
             $insertOrderData['orderData']['pmId'] = $calcInfo[1];
             if (count($insertOrderData['orderDetail']) > 1) {
                 $insertOrderData['orderData']['orderAttribute'] = 3;
             } else {
                 if (isset($insertOrderData['orderDetail'][0]['orderDetailData']['amount']) && $insertOrderData['orderDetail'][0]['orderDetailData']['amount'] > 1) {
                     $insertOrderData['orderData']['orderAttribute'] = 2;
                 }
             }
             $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, 1);
             //计算运费
             $insertOrderData['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
             $insertOrderData['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
             //print_r($insertOrderData); exit;
             if ($_spitId = OrderAddModel::insertAllOrderRowNoEvent($insertOrderData)) {
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:abnormalStock.action.php


注:本文中的CommonModel::calcAddOrderWeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。