Ejemplo n.º 1
0
 public function testDeliveryCost()
 {
     $delivery = Delivery::getDelivery(Delivery::MOSCOW, DeliveryTypes::KURIER_MOSCOW);
     // cost
     $cost = $delivery->getDeliveryCost();
     // Assert
     $this->assertEquals(150, $cost);
 }
Ejemplo n.º 2
0
 /**
  * @brief 获得配送方式ajax
  */
 public static function order_delivery()
 {
     $data = array();
     //获取post的值
     $province = IReq::get("province");
     $weight = (int) IReq::get('weight');
     //商品总价
     $goodsSum = floatval(IReq::get('goodsSum'));
     //初始化配送方式类
     $delivery = new Delivery();
     //调入数据,获得配送方式结果
     $data = $delivery->getDelivery($province, $weight, $goodsSum);
     echo JSON::encode($data);
 }
Ejemplo n.º 3
0
 /**
  * 计算订单信息,其中部分计算都是以商品原总价格计算的$goodsSum
  * @param $goodsSum float 商品原总金额
  * @param $goodsFinalSum 商品应付总金额
  * @param $goodsWeight float 商品总重量
  * @param $province_id int 省份ID
  * @param $delievery_id int 配送方式ID
  * @param $payment_id int 支付ID
  * @param $is_freeDelievery boolean 是否免运费
  * @param $is_insured boolean 是否有保价
  * @param $is_invoice boolean 是否要发票
  * @param $discount float 订单的加价或者减价
  * @return $result 最终的返回数组
  */
 public static function countOrderFee($goodsSum, $goodsFinalSum, $goodsWeight, $province_id, $delivery_id, $payment_id, $is_freeDelievery, $is_insured, $is_invoice, $discount = 0)
 {
     //最终的返回数组
     $result = array('deliveryOrigPrice' => 0, 'deliveryPrice' => 0, 'insuredPrice' => 0, 'taxPrice' => 0, 'paymentPrice' => 0, 'orderAmountPrice' => 0);
     //计算运费和保价
     $deliveryList = Delivery::getDelivery($province_id, $goodsWeight, $goodsSum);
     //运费设置
     $result['deliveryOrigPrice'] = $result['deliveryPrice'] = isset($deliveryList[$delivery_id]['price']) ? $deliveryList[$delivery_id]['price'] : 0;
     //免运费
     if ($is_freeDelievery == true) {
         $result['deliveryPrice'] = 0;
     }
     //需要保价
     if ($is_insured == true) {
         $result['insuredPrice'] = $deliveryList[$delivery_id]['protect_price'];
     }
     //获取税率$tax
     if ($is_invoice == true) {
         $result['taxPrice'] = self::getGoodsTax($goodsSum);
     }
     //非货到付款的线上支付方式手续费
     if ($payment_id != 0) {
         $result['paymentPrice'] = self::getGoodsPaymentPrice($payment_id, $goodsSum);
     }
     //最终订单金额计算
     $order_amount = $goodsFinalSum + $result['deliveryPrice'] + $result['insuredPrice'] + $result['taxPrice'] + $result['paymentPrice'] + $discount;
     $result['orderAmountPrice'] = $order_amount <= 0 ? 0 : round($order_amount, 2);
     return $result;
 }
Ejemplo n.º 4
0
 /**
  * @brief 获得配送方式ajax
  */
 public function order_delivery()
 {
     $province = IFilter::act(IReq::get("province"), 'int');
     $weight = IFilter::act(IReq::get('total_weight'), 'float');
     $goodsSum = IFilter::act(IReq::get('goodsSum'), 'float');
     $distribution = IFilter::act(IReq::get("distribution"), 'int');
     //调入数据,获得配送方式结果
     $data = Delivery::getDelivery($province, $weight, $goodsSum);
     if ($distribution) {
         echo JSON::encode($data[$distribution]);
     } else {
         echo JSON::encode($data);
     }
 }
Ejemplo n.º 5
0
 /**
  * @brief 获得配送方式ajax
  */
 public function order_delivery()
 {
     $productId = IFilter::act(IReq::get("productId"), 'int');
     $goodsId = IFilter::act(IReq::get("goodsId"), 'int');
     $province = IFilter::act(IReq::get("province"), 'int');
     $distribution = IFilter::act(IReq::get("distribution"), 'int');
     $num = IReq::get("num") ? IFilter::act(IReq::get("num"), 'int') : 1;
     $data = array();
     if ($distribution) {
         $data = Delivery::getDelivery($province, $distribution, $goodsId, $productId, $num);
     } else {
         $delivery = new IModel('delivery');
         $deliveryList = $delivery->query('is_delete = 0 and status = 1');
         foreach ($deliveryList as $key => $item) {
             $data[$item['id']] = Delivery::getDelivery($province, $item['id'], $goodsId, $productId, $num);
         }
     }
     echo JSON::encode($data);
 }
Ejemplo n.º 6
0
 /**
  * 修改收件人信息
  * */
 public function order_accept()
 {
     $id = IFilter::act(IReq::get('order_id'), 'int');
     $mess = '';
     if ($id) {
         $order_array = array('postcode' => IFilter::act(IReq::get('postcode')), 'accept_name' => IFilter::act(IReq::get('accept_name')), 'province' => IFilter::act(IReq::get('province')), 'city' => IFilter::act(IReq::get('city')), 'area' => IFilter::act(IReq::get('area')), 'school' => IFilter::act(IReq::get('school')), 'address' => IFilter::act(IReq::get('address')), 'telphone' => IFilter::act(IReq::get('telphone')), 'mobile' => IFilter::act(IReq::get('mobile')));
         $tb_order = new IModel('order');
         $orderRow = $tb_order->getObj('id = ' . $id);
         //比对省份是否改变,从而重新计算运费
         if ($order_array['province'] != $orderRow['province']) {
             //获取订单物品重量
             $goods_weight = IFilter::act(IReq::get('goods_weight'), 'float');
             //调入数据,获得配送方式结果
             $deliveryData = Delivery::getDelivery($order_array['province'], $goods_weight);
             //所选择的省份不能送达
             if ($deliveryData[$orderRow['distribution']]['if_delivery'] == 1) {
                 $mess = '对不起,该地区不能送达,请您重新选择省份';
             } else {
                 if ($deliveryData[$orderRow['distribution']]['price'] != $orderRow['payable_freight']) {
                     $order_array['payable_freight'] = $deliveryData[$orderRow['distribution']]['price'];
                     //非免运费
                     if ($orderRow['real_freight'] > 0) {
                         $order_array['real_freight'] = $order_array['payable_freight'];
                         //修正订单最终总金额
                         $order_array['order_amount'] = $orderRow['order_amount'] + $order_array['payable_freight'] - $orderRow['real_freight'];
                     }
                 }
             }
         }
         //无错误信息运行正常
         if ($mess == '') {
             $mess = '更新成功!';
             $tb_order->setData($order_array);
             if ($tb_order->update('id = ' . $id . ' and user_id = ' . $this->user['user_id']) === false) {
                 $mess = '收件人更新失败!';
             }
         }
     } else {
         $mess = '您的操作失败!';
     }
     IReq::set('id', $id);
     $this->order_detail();
     Util::showMessage($mess);
 }
Ejemplo n.º 7
0
 /**
  * 计算订单信息,其中部分计算都是以商品原总价格计算的$goodsSum
  * @param $goodsResult array CountSum结果集
  * @param $province_id int 省份ID
  * @param $delievery_id int 配送方式ID
  * @param $payment_id int 支付ID
  * @param $is_invoice int 是否要发票
  * @param $discount float 订单的加价或者减价
  * @param $promo string 促销活动
  * @param $active_id int 促销活动ID
  * @return $result 最终的返回数组
  */
 public function countOrderFee($goodsResult, $province_id, $delivery_id, $payment_id, $is_invoice, $discount = 0, $promo = '', $active_id = '')
 {
     //根据商家进行商品分组
     $sellerGoods = array();
     foreach ($goodsResult['goodsList'] as $key => $val) {
         if (!isset($sellerGoods[$val['seller_id']])) {
             $sellerGoods[$val['seller_id']] = array();
         }
         $sellerGoods[$val['seller_id']][] = $val;
     }
     $cartObj = new Cart();
     foreach ($sellerGoods as $seller_id => $item) {
         $num = array();
         $productID = array();
         $goodsID = array();
         $goodsArray = array();
         $productArray = array();
         foreach ($item as $key => $val) {
             $goodsID[] = $val['goods_id'];
             $productID[] = $val['product_id'];
             $num[] = $val['count'];
             if ($val['product_id'] > 0) {
                 $productArray[$val['product_id']] = $val['count'];
             } else {
                 $goodsArray[$val['goods_id']] = $val['count'];
             }
         }
         $sellerData = $this->goodsCount($cartObj->cartFormat(array("goods" => $goodsArray, "product" => $productArray)), $promo, $active_id);
         if (is_string($sellerData)) {
             return $sellerData;
         }
         $deliveryList = Delivery::getDelivery($province_id, $delivery_id, $goodsID, $productID, $num);
         if (is_string($deliveryList)) {
             return $deliveryList;
         }
         $extendArray = array('deliveryOrigPrice' => $deliveryList['org_price'], 'deliveryPrice' => $deliveryList['price'], 'insuredPrice' => $deliveryList['protect_price'], 'taxPrice' => $is_invoice == true ? $sellerData['tax'] : 0, 'paymentPrice' => $payment_id != 0 ? self::getGoodsPaymentPrice($payment_id, $sellerData['final_sum']) : 0, 'goodsResult' => $sellerData, 'orderAmountPrice' => 0);
         $orderAmountPrice = array_sum(array($sellerData['final_sum'], $deliveryList['price'], $deliveryList['protect_price'], $extendArray['taxPrice'], $extendArray['paymentPrice'], $discount));
         $extendArray['orderAmountPrice'] = $orderAmountPrice <= 0 ? 0 : round($orderAmountPrice, 2);
         $sellerGoods[$val['seller_id']] = array_merge($sellerData, $extendArray);
     }
     return $sellerGoods;
 }
Ejemplo n.º 8
0
echo isset($_GET['user']) ? $client['email'] : $email;
?>
</td>
									</tr>
									<tr>
										<td class="tdname">Пожелания к заказу</td>
										<td><?php 
echo nl2br($message);
?>
</td>
									</tr>
								</table>
							</li>
							<li class="edit_form_section edit_form_section_info plugin_orders_info">
								<?php 
Delivery::getDelivery();
?>
							</li>
							<li class="edit_form_section edit_form_section_info plugin_orders_info">
								<?php 
Payment::getPayment();
?>
							</li>
							<li class="edit_form_section edit_form_section_description">
								<header class="edit_form_section_header">
									<strong>Дополнительная информация</strong>
								</header>
								<div class="ckeditor_layout">
									<textarea class="ckeditor_textarea input_text" id="info" name=info><?php 
echo $info;
?>
Ejemplo n.º 9
0
    include $class_name . '.class.php';
}
ini_set('display_errors', 1);
error_reporting(E_ALL);
// создаем товары в корзине
$odezhda1 = new Odezhda();
$odezhda1->setTitle('Брюки синие');
$odezhda1->setCost(1500);
$odezhda2 = new Odezhda();
$odezhda2->setTitle('Топ красный');
$odezhda2->setCost(1000);
$aksessuar1 = new Aksessuary();
$aksessuar1->setTitle('Часы золотые');
$aksessuar1->setCost(10000);
$korzina = new Checkout();
$korzina->addProduct($odezhda1);
$korzina->addProduct($odezhda2);
$korzina->addProduct($aksessuar1);
// на какую сумму товаров в корзине
print sprintf('<br>Товаров в корзине на %s рублей', $korzina->getCost());
//доставка в Москве курьером
$delivery = Delivery::getDelivery(Delivery::MOSCOW, DeliveryTypes::KURIER_MOSCOW);
print sprintf('<br><br> %s, %d рублей', $delivery->getDeliveryTitle(), $delivery->getDeliveryCost());
//итоговая сумма с доставкой
print sprintf('<br><br> Стоимость товаров с доставкой %s рублей', $korzina->getFinalCost($delivery));
try {
    //доставка в Москве не доступным для региона способом выдаст исключение
    $delivery = Delivery::getDelivery(Delivery::MOSCOW, DeliveryTypes::DPD);
} catch (Exception $e) {
    print sprintf('<br><br> Пойманное исключение: %s', $e->getMessage());
}
Ejemplo n.º 10
0
 function cart3()
 {
     $accept_name = IFilter::act(IReq::get('accept_name'));
     $province = IFilter::act(IReq::get('province'), 'int');
     $city = IFilter::act(IReq::get('city'), 'int');
     $area = IFilter::act(IReq::get('area'), 'int');
     $address = IFilter::act(IReq::get('address'));
     $mobile = IFilter::act(IReq::get('mobile'));
     $telphone = IFilter::act(IReq::get('telphone'));
     $zip = IFilter::act(IReq::get('zip'));
     $delivery_id = IFilter::act(IReq::get('delivery_id'), 'int');
     $accept_time_radio = IFilter::act(IReq::get('accept_time_radio'), 'int');
     $accept_time = IFilter::act(IReq::get('accept_time'));
     $payment = IFilter::act(IReq::get('payment'), 'int');
     $order_message = IFilter::act(IReq::get('message'));
     $ticket_id = IFilter::act(IReq::get('ticket_id'), 'int');
     $is_tax = IFilter::act(IReq::get('is_tax'), 'int');
     $tax_title = IFilter::act(IReq::get('tax_title'), 'text');
     $gid = intval(IReq::get('direct_gid'));
     $num = intval(IReq::get('direct_num'));
     $type = IFilter::act(IReq::get('direct_type'));
     //商品或者货品
     $promo = IFilter::act(IReq::get('direct_promo'));
     $active_id = intval(IReq::get('direct_active_id'));
     $tourist = IReq::get('tourist');
     //游客方式购物
     $order_no = block::createOrderNum();
     $order_type = 0;
     $is_protectPrice = IFilter::act(IReq::get('protect_price'));
     $dataArray = array();
     //防止表单重复提交
     if (IReq::get('timeKey') != null) {
         if (ISafe::get('timeKey') == IReq::get('timeKey')) {
             IError::show(403, '订单数据不能被重复提交');
             exit;
         } else {
             ISafe::set('timeKey', IReq::get('timeKey'));
         }
     }
     if ($province == 0 || $city == 0 || $area == 0) {
         IError::show(403, '请填写收货地址的省市地区');
     }
     if ($delivery_id == 0) {
         IError::show(403, '请选择配送方式');
     }
     $user_id = $this->user['user_id'] == null ? 0 : $this->user['user_id'];
     //活动特殊处理
     if ($promo != '' && $active_id != '') {
         //团购
         if ($promo == 'groupon') {
             $hashId = $user_id ? $user_id : ICookie::get("regiment_{$active_id}");
             //此团购还存在已经报名但是未付款的情况
             if (regiment::hasJoined($active_id, $hashId) == true) {
                 IError::show(403, '您已经参加过此次团购,请先完成支付');
                 exit;
             }
             //团购已经达到限定的人数
             if (regiment::isFull($active_id) == true) {
                 IError::show(403, '此团购的参加人数已满');
                 exit;
             }
             $order_type = 1;
             //团购开始报名
             $joinUserId = $user_id ? $user_id : null;
             $resultData = regiment::join($active_id, $joinUserId);
             $is_success = '';
             if ($resultData['flag'] == true) {
                 $regimentRelationObj = new IModel('regiment_user_relation');
                 $regimentRelationObj->setData(array('order_no' => $order_no));
                 $is_success = $regimentRelationObj->update('id = ' . $resultData['relation_id']);
             }
             if ($is_success == '' || $resultData['flag'] == false) {
                 $errorMsg = isset($resultData['data']) && $resultData['data'] != '' ? $resultData['data'] : '团购报名失败';
                 IError::show(403, $errorMsg);
                 exit;
             }
         } else {
             if ($promo == 'time') {
                 $order_type = 2;
             }
         }
     }
     //付款方式,判断是否为货到付款
     $deliveryObj = new IModel('delivery');
     $deliveryRow = $deliveryObj->getObj('id = ' . $delivery_id, 'type');
     if ($deliveryRow['type'] == 0 && $payment == 0) {
         IError::show(403, '请选择支付方式');
     } else {
         if ($deliveryRow['type'] == 1) {
             $payment = 0;
         }
     }
     $countSumObj = new CountSum();
     //直接购买商品方式
     if ($type != '' && $gid != 0) {
         //计算$gid商品
         $goodsResult = $countSumObj->direct_count($gid, $type, $num, $promo, $active_id);
     } else {
         //计算购物车中的商品价格$goodsResult
         $goodsResult = $countSumObj->cart_count();
         //清空购物车
         $cartObj = new Cart();
         $cartObj->clear();
     }
     //判断商品商品是否存在
     if (empty($goodsResult['goodsList']) && empty($goodsResult['productList'])) {
         IError::show(403, '商品数据不存在');
         exit;
     }
     $sum_r = $goodsResult['sum'];
     $proReduce_r = $goodsResult['proReduce'];
     $reduce_r = $goodsResult['reduce'];
     $final_sum_r = $goodsResult['final_sum'];
     $freeFreight_r = $goodsResult['freeFreight'];
     $point_r = $goodsResult['point'];
     $exp_r = $goodsResult['exp'];
     //计算运费$deliveryPrice和保价$protect_price
     $deliveryList = Delivery::getDelivery($province, $goodsResult['weight'], $final_sum_r);
     $deliveryPrice = $deliveryList[$delivery_id]['price'];
     if ($is_protectPrice == null) {
         $protect_price = 0;
         $if_insured = 0;
     } else {
         $protect_price = $deliveryList[$delivery_id]['protect_price'];
         $if_insured = 1;
     }
     if ($freeFreight_r == true) {
         $deliveryPrice_r = 0;
     } else {
         $deliveryPrice_r = $deliveryPrice;
     }
     //获取红包减免金额
     if ($ticket_id != '') {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'prop,custom');
         if (ISafe::get('ticket_' . $ticket_id) == $ticket_id || stripos(',' . trim($memberRow['prop'], ',') . ',', ',' . $ticket_id . ',') !== false) {
             $propObj = new IModel('prop');
             $ticketRow = $propObj->getObj('id = ' . $ticket_id . ' and NOW() between start_time and end_time and type = 0 and is_close = 0 and is_userd = 0 and is_send = 1');
             if (!empty($ticketRow)) {
                 $ticket_value = $ticketRow['value'];
                 $reduce_r += $ticket_value;
                 $final_sum_r -= $ticket_value;
                 $dataArray['prop'] = $ticket_id;
             }
             //锁定红包状态
             $propObj->setData(array('is_close' => 2));
             $propObj->update('id = ' . $ticket_id);
         }
     }
     //获取税率$tax
     if ($is_tax == 1) {
         $siteConfigObj = new Config("site_config");
         $site_config = $siteConfigObj->getInfo();
         $tax_per = isset($site_config['tax']) ? $site_config['tax'] : 0;
         $tax = $final_sum_r * ($tax_per / 100);
     } else {
         $tax = 0;
     }
     //货到付款的方式
     if ($payment == 0) {
         $paymentName = '货到付款';
         $payment_fee = 0;
         $paymentType = 0;
         $paymentNote = '';
     } else {
         //计算支付手续费
         $paymentObj = new IModel('payment');
         $paymentRow = $paymentObj->getObj('id = ' . $payment, 'type,poundage,poundage_type,name,note');
         $paymentName = $paymentRow['name'];
         $paymentType = $paymentRow['type'];
         $paymentNote = $paymentRow['note'];
         if ($paymentRow['poundage_type'] == 1) {
             $payment_fee = ($final_sum_r + $tax + $deliveryPrice_r + $protect_price) * ($paymentRow['poundage'] / 100);
         } else {
             $payment_fee = $paymentRow['poundage'];
         }
     }
     //最终订单金额计算
     $order_amount = $final_sum_r + $deliveryPrice_r + $payment_fee + $tax + $protect_price;
     $order_amount = $order_amount <= 0 ? 0 : round($order_amount, 2);
     //生成的订单数据
     $dataArray = array('order_no' => $order_no, 'user_id' => $user_id, 'accept_name' => $accept_name, 'pay_type' => $payment, 'distribution' => $delivery_id, 'status' => 1, 'pay_status' => 0, 'distribution_status' => 0, 'postcode' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile, 'create_time' => ITime::getDateTime(), 'invoice' => $is_tax, 'postscript' => $order_message, 'invoice_title' => $tax_title, 'accept_time' => $accept_time, 'exp' => $exp_r, 'point' => $point_r, 'type' => $order_type, 'prop' => isset($dataArray['prop']) ? $dataArray['prop'] : null, 'payable_amount' => $goodsResult['sum'], 'real_amount' => $goodsResult['final_sum'], 'payable_freight' => $deliveryPrice, 'real_freight' => $deliveryPrice_r, 'pay_fee' => $payment_fee, 'taxes' => $tax, 'promotions' => $proReduce_r + $reduce_r, 'order_amount' => $order_amount, 'if_insured' => $if_insured, 'insured' => $protect_price);
     $orderObj = new IModel('order');
     $orderObj->setData($dataArray);
     $this->order_id = $orderObj->add();
     if ($this->order_id == false) {
         IError::show(403, '订单生成错误');
     }
     /*将订单中的商品插入到order_goods表*/
     $orderGoodsObj = new IModel('order_goods');
     $goodsArray = array('order_id' => $this->order_id);
     $findType = array('goods' => 'goodsList', 'product' => 'productList');
     foreach ($findType as $key => $list) {
         if (isset($goodsResult[$list]) && count($goodsResult[$list]) > 0) {
             foreach ($goodsResult[$list] as $k => $val) {
                 //拼接商品名称和规格数据
                 $specArray = array('name' => $val['name'], 'value' => '');
                 if ($key == 'product') {
                     $goodsArray['product_id'] = $val['id'];
                     $goodsArray['goods_id'] = $val['goods_id'];
                     $spec = block::show_spec($val['spec_array']);
                     foreach ($spec as $skey => $svalue) {
                         $specArray['value'] .= $skey . ':' . $svalue . ' , ';
                     }
                 } else {
                     $goodsArray['goods_id'] = $val['id'];
                     $goodsArray['product_id'] = 0;
                 }
                 $specArray = serialize($specArray);
                 $goodsArray['goods_price'] = $val['sell_price'];
                 $goodsArray['real_price'] = $val['sell_price'] - $val['reduce'];
                 $goodsArray['goods_nums'] = $val['count'];
                 $goodsArray['goods_weight'] = $val['weight'];
                 $goodsArray['goods_array'] = $specArray;
                 $orderGoodsObj->setData($goodsArray);
                 $orderGoodsObj->add();
             }
         }
     }
     //更改购买商品的库存数量
     Block::updateStore($this->order_id, 'reduce');
     //记录用户默认习惯的数据
     if (!isset($memberRow['custom'])) {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'custom');
     }
     $memberData = array('custom' => serialize(array('payment' => $payment, 'delivery' => $delivery_id)));
     $memberObj->setData($memberData);
     $memberObj->update('user_id = ' . $user_id);
     //收货地址的处理
     if ($user_id) {
         $addressObj = new IModel('address');
         //如果用户之前没有收货地址,那么会自动记录此次的地址信息并且为默认
         $addressRow = $addressObj->getObj('user_id = ' . $user_id);
         if (empty($addressRow)) {
             $addressData = array('default' => '1', 'user_id' => $user_id, 'accept_name' => $accept_name, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'zip' => $zip, 'telphone' => $telphone, 'mobile' => $mobile);
             $addressObj->setData($addressData);
             $addressObj->add();
         } else {
             //如果用户有收货地址,但是没有设置默认项,那么会自动设置此次地址信息为默认
             $radio_address = intval(IReq::get('radio_address'));
             if ($radio_address != 0) {
                 $addressDefRow = $addressObj->getObj('user_id = ' . $user_id . ' and `default` = 1');
                 if (empty($addressDefRow)) {
                     $addressData = array('default' => 1);
                     $addressObj->setData($addressData);
                     $addressObj->update('user_id = ' . $user_id . ' and id = ' . $radio_address);
                 }
             }
         }
     }
     //获取备货时间
     $siteConfigObj = new Config("site_config");
     $site_config = $siteConfigObj->getInfo();
     $this->stockup_time = isset($site_config['stockup_time']) ? $site_config['stockup_time'] : 2;
     //数据渲染
     $this->order_num = $dataArray['order_no'];
     $this->final_sum = $dataArray['order_amount'];
     $this->payment_fee = $payment_fee;
     $this->payment = $paymentName;
     $this->delivery = $deliveryList[$delivery_id]['name'];
     $this->tax_title = $tax_title;
     $this->deliveryType = $deliveryRow['type'];
     $this->paymentType = $paymentType;
     $this->paymentNote = $paymentNote;
     //订单金额为0时,订单自动完成
     if ($this->final_sum <= 0) {
         $order_id = payment::updateOrder($dataArray['order_no']);
         if ($order_id != '') {
             if ($user_id) {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货") . '/?callback=ucenter/order_detail/id/' . $order_id);
             } else {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货"));
             }
         } else {
             IError::show(403, '订单修改失败');
         }
     } else {
         $this->redirect('cart3');
     }
 }