} else { $result['error'] = 1; $result['message'] = $GLOBALS['err']->last_message(); } die($json->encode($result)); } else { if ($action == 'track_packages') { include_once ROOT_PATH . 'includes/lib_transaction.php'; include_once ROOT_PATH . 'includes/lib_order.php'; $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1; $orders = array(); $sql = "SELECT order_id,order_sn,invoice_no,shipping_id FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}' AND shipping_status = '" . SS_SHIPPED . "'"; $res = $db->query($sql); $record_count = 0; while ($item = $db->fetch_array($res)) { $shipping = get_shipping_object($item['shipping_id']); if (method_exists($shipping, 'query')) { $query_link = $shipping->query($item['invoice_no']); } else { $query_link = $item['invoice_no']; } if ($query_link != $item['invoice_no']) { $item['query_link'] = $query_link; $orders[] = $item; $record_count += 1; } } $pager = get_pager('user.php', array('act' => $action), $record_count, $page); $smarty->assign('pager', $pager); $smarty->assign('orders', $orders); $smarty->display('user_transaction.dwt');
/** * 订单跟踪 */ public function order_tracking() { $order_id = I('get.order_id', 0); $ajax = I('get.ajax', 0); $where['user_id'] = $this->user_id; $where['order_id'] = $order_id; $orders = $this->model->table('order_info')->field('order_id, order_sn, invoice_no, shipping_name, shipping_id')->where($where)->find(); // 生成快递100查询接口链接 $shipping = get_shipping_object($orders['shipping_id']); $query_link = $shipping->kuaidi100($orders['invoice_no']); $get_content = Http::doGet($query_link); $this->assign('title', L('order_tracking')); $this->assign('trackinfo', $get_content); $this->display('user_order_tracking.dwt'); }
function action_track_packages() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $_SESSION['user_id']; include_once ROOT_PATH . 'includes/lib_transaction.php'; include_once ROOT_PATH . 'includes/lib_order.php'; $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1; $orders = array(); $sql = "SELECT order_id,order_sn,invoice_no,shipping_id FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}' AND shipping_status = '" . SS_SHIPPED . "'"; $res = $db->query($sql); $record_count = 0; while ($item = $db->fetch_array($res)) { $shipping = get_shipping_object($item['shipping_id']); if (method_exists($shipping, 'query')) { $query_link = $shipping->query($item['invoice_no']); } else { $query_link = $item['invoice_no']; } if ($query_link != $item['invoice_no']) { $item['query_link'] = $query_link; $orders[] = $item; $record_count += 1; } } $pager = get_pager('user.php', array('act' => $action), $record_count, $page); $smarty->assign('pager', $pager); $smarty->assign('orders', $orders); $smarty->display('user_transaction.dwt'); }
if (empty($goods_list)) { $tips = '<br><br>无效错误订单<br><br><a href=user.php?act=order_list class=red>返回我的订单</a>'; $smarty->assign('tips', $tips); $smarty->display('order_done.dwt'); exit; } foreach ($goods_list as $key => $value) { $goods_list[$key]['market_price'] = price_format($value['market_price'], false); $goods_list[$key]['goods_price'] = price_format($value['goods_price'], false); $goods_list[$key]['subtotal'] = price_format($value['subtotal'], false); } /* 订单 支付 配送 状态语言项 */ $order['order_status'] = $_LANG['os'][$order['order_status']]; $order['pay_status'] = $_LANG['ps'][$order['pay_status']]; $order['shipping_status'] = $_LANG['ss'][$order['shipping_status']]; $shipping = get_shipping_object($order['shipping_id']); if (method_exists($shipping, 'query')) { $query_link = $shipping->query($order['invoice_no']); } else { $query_link = $order['invoice_no']; } if ($query_link != $order['invoice_no']) { $order['query_link'] = "[单号:" . $query_link . "]"; } $smarty->assign('order', $order); $smarty->assign('goods_list', $goods_list); $smarty->assign('lang', $_LANG); $smarty->assign('footer', get_footer()); $smarty->display('order_info.dwt'); exit; } elseif ($act == 'cancel_order') {