本文整理汇总了PHP中commonModel::auto_contrast_intercept方法的典型用法代码示例。如果您正苦于以下问题:PHP commonModel::auto_contrast_intercept方法的具体用法?PHP commonModel::auto_contrast_intercept怎么用?PHP commonModel::auto_contrast_intercept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commonModel
的用法示例。
在下文中一共展示了commonModel::auto_contrast_intercept方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_aliexpressimport
//.........这里部分代码省略.........
}
}
}
}
$transportation = CommonModel::getCarrierList();
//所有的
foreach ($transportation as $tranValue) {
if ($tranValue['carrierNameCn'] == $carrierNameCn) {
$orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id'];
break;
}
//$transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
}
//order扩展信息
$orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
$orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS";
$orderData[$recordNumber]['orderExtenData']['transId'] = $recordNumber;
// 交易id;;
$orderData[$recordNumber]['orderExtenData']['platformUsername'] = $platformUsername;
//$orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
//user信息
$orderData[$recordNumber]['orderUserInfoData']['platformUsername'] = $platformUsername;
$orderData[$recordNumber]['orderUserInfoData']['username'] = $username;
$orderData[$recordNumber]['orderUserInfoData']['email'] = $email;
$orderData[$recordNumber]['orderUserInfoData']['street'] = $street;
$orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency;
$orderData[$recordNumber]['orderUserInfoData']['address2'] = $address2;
$orderData[$recordNumber]['orderUserInfoData']['address3'] = $address3;
$orderData[$recordNumber]['orderUserInfoData']['city'] = $city;
$orderData[$recordNumber]['orderUserInfoData']['state'] = $state;
$orderData[$recordNumber]['orderUserInfoData']['zipCode'] = $zipCode;
$orderData[$recordNumber]['orderUserInfoData']['countryName'] = $countryName;
$orderData[$recordNumber]['orderUserInfoData']['landline'] = $landline;
//detail信息
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] = $amount;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['itemPrice'] = $itemPrice;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['shippingFee'] = $shippingFee;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time();
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $itemTitle;
//$orderData['orderDetail']['orderDetailExtenData']['note'] = $value[10];
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['transId'] = $transId;
//note信息
if (!empty($note)) {
$orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
$orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
}
}
}
//echo "<pre>";print_r($orderData);
$message = "";
foreach ($orderData as $id => $order) {
$msg = commonModel::checkOrder($id);
if ($msg) {
$message .= "<font color='red'>订单{$id}已存在!</font><br>";
continue;
}
//计算订单属性
if (count($order['orderDetail']) == 1) {
$detail = current($order['orderDetail']);
if ($detail['orderDetailData']['amount'] == 1) {
$orderData[id]['orderData']['orderAttribute'] = 1;
} else {
$orderData[id]['orderData']['orderAttribute'] = 2;
}
} else {
$orderData[id]['orderData']['orderAttribute'] = 3;
}
//计算订单重量及包材
$obj_order_detail_data = array();
foreach ($order['orderDetail'] as $sku => $detail) {
$obj_order_detail_data[] = $detail['orderDetailData'];
}
$weightfee = commonModel::calcOrderWeight($obj_order_detail_data);
$orderData[$id]['orderData']['calcWeight'] = $weightfee[0];
//$orderData[$value[0]]['orderData']['calcShipping'] = $weightfee[3];
$orderData[$id]['orderData']['pmId'] = $weightfee[1];
//计算运费
$calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, $orderData[$id]['orderData']['isFixed']);
//计算运费
$orderData[$id]['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
//缺货拦截
$status = commonModel::auto_contrast_intercept($orderData[$id]);
$orderData[$id]['orderData']['orderStatus'] = $status['orderStatus'];
$orderData[$id]['orderData']['orderType'] = $status['orderType'];
//print_r($order);
//插入订单
$info = OrderAddModel::insertAllOrderRowNoEvent($order);
if ($info) {
$message .= "<font color='green'>订单{$id}上传成功!</font><br>";
} else {
$message .= "<font color='red'>订单{$id}上传失败!</font><br>";
}
}
$this->smarty->assign("showerrorinfo", $message);
//header("location:index.php?mod=underLineOrderImport&act=importOrder");
}
$this->smarty->display('underLineOrderImport.htm');
}