本文整理汇总了PHP中commonModel::calcOrderWeight方法的典型用法代码示例。如果您正苦于以下问题:PHP commonModel::calcOrderWeight方法的具体用法?PHP commonModel::calcOrderWeight怎么用?PHP commonModel::calcOrderWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commonModel
的用法示例。
在下文中一共展示了commonModel::calcOrderWeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_sureAddOrder
//.........这里部分代码省略.........
//detail信息
$sku = $sku_list[$i];
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku_list[$i];
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] += $sku_count[$i];
//累加
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber;
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time();
$orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $ebay_itemtitle[$i];
}
foreach ($orderData as $id => $order) {
//$orderData 中第一维只有一个元素,方便起见这里用foreach,虽然只循环一次
$ret = commonModel::checkOrder($recordNumber);
if ($ret) {
$returnArr['errCode'] = 101;
$returnArr['errMsg'] = "订单{$recordNumber}已存在!";
return $returnArr;
}
//计算订单属性
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[$id]['orderData']['pmId'] = $weightfee[1];
$calcShippingInfo = CommonModel::calcAddOrderShippingFee($orderData[$id], $orderData[$id]['orderData']['isFixed']);
//计算运费
$orderData[$id]['orderData']['channelId'] = $calcShippingInfo['channelId'];
$orderData[$id]['orderData']['calcShipping'] = $calcShippingInfo['fee'];
//调用旧系统接口,先插入数据到旧系统
$rtn = OldsystemModel::orderErpInsertorder($orderData[$id]);
$insertData = array();
if (empty($rtn)) {
$returnArr['errCode'] = 102;
$returnArr['errMsg'] = "接口返回异常,请重试!";
return $returnArr;
}
if ($rtn['errcode'] == 200) {
$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[$id]['orderData']['id'] = $orderId;
//赋予新系统订单编号
if ($orderData['orderData']['calcWeight'] != $totalweight) {
$insertData['old_totalweight'] = $totalweight;
$insertData['new_totalweight'] = $orderData[$id]['orderData']['calcWeight'];
$orderData[$id]['orderData']['calcWeight'] = $totalweight;
}
if ($orderData['orderData']['pmId'] != $pmId) {
示例2: 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;
}
}
示例3: view_guoneiSaleImport
//.........这里部分代码省略.........
$orderData[$recordNumber]['orderData']['isFixed'] = 1;
}
}
}
}
foreach ($transportation as $tranValue) {
if ($tranValue['carrierNameCn'] == $carrierNameCn) {
$orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id'];
break;
}
}
if ($trackNumber != '') {
$orderData[$recordNumber]['orderTrack']['tracknumber'] = $trackNumber;
$orderData[$recordNumber]['orderTrack']['addUser'] = $_SESSION['sysUserId'];
$orderData[$recordNumber]['orderTrack']['createdTime'] = time();
}
//order扩展信息
$orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
$orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS";
$orderData[$recordNumber]['orderExtenData']['transId'] = $recordNumber;
// 交易id;;
$orderData[$recordNumber]['orderExtenData']['PayPalPaymentId'] = $PayPalPaymentId;
$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'] = $street1;
$orderData[$recordNumber]['orderUserInfoData']['address2'] = ${$street2};
$orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency;
//$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'] = $phone;
$orderData[$recordNumber]['orderUserInfoData']['phone'] = $phone;
//note信息
if (!empty($note)) {
$orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
$orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
}
}
//print_r($orderData);
//echo "<pre>";print_r($orderData);//exit;
$message = "";
foreach ($orderData as $id => $order) {
//echo $id;
//$msg = commonModel::checkOrder($id);
$msg = commonModel::checkRecordNumber($id, $platformId, $plataccountId);
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'];
//$orderData[$id]['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
//缺货拦截
$orderData[$id] = AutoModel::auto_contrast_intercept($orderData[$id]);
/*$orderData[$id]['orderData']['orderStatus'] = $status['orderStatus'];
$orderData[$id]['orderData']['orderType'] = $status['orderType'];*/
//echo "<pre>";print_r($orderData[$id]);
//print_r($orderData);
//exit;
//插入订单
$info = OrderAddModel::insertAllOrderRowNoEvent($orderData[$id]);
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('guoneiSaleImport.htm');
}
示例4: 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');
}