private function get_order_info($order_id) { $model_order = Model('order'); $order_info = $model_order->getOrderInfo(array('order_id' => $order_id), array('order_goods')); if (empty($order_info)) { uk86_showMessage(Uk86Language::uk86_get('param_error')); } $order_info['order_state_text'] = uk86_orderState($order_info); return $order_info; }
( 支付单号 <?php echo $lang['nc_colon']; ?> <?php echo $output['order_info']['pay_sn']; ?> ) </li> <li><strong><?php echo $lang['order_state']; ?> :</strong><?php if ($output['order_info']['lock_state']) { echo "审核中"; } else { echo uk86_orderState($output['order_info']); } ?> </li> <li><strong><?php echo $lang['order_total_price']; ?> :</strong><span class="red_common"><?php echo $lang['currency'] . $output['order_info']['order_amount']; ?> </span> <?php if ($output['order_info']['refund_amount'] > 0) { ?> (<?php echo $lang['order_refund'];
echo date('Y-m-d H:i:s', $order['add_time']); ?> </td> <td class="align-center"><?php echo $order['order_amount']; ?> </td> <td class="align-center"><?php echo uk86_orderPaymentName($order['payment_code']); ?> </td> <td class="align-center"><?php if ($order['lock_state'] == "1") { echo "审核中"; } else { echo uk86_orderState($order); } ?> </td> <td class="w144 align-center"><a href="index.php?act=order&op=show_order&order_id=<?php echo $order['order_id']; ?> "><?php echo $lang['nc_view']; ?> </a> <!-- 取消订单 --> <?php if ($order['if_cancel']) { ?>
/** * 生成excel * * @param array $data */ private function createExcel($data = array()) { Uk86Language::uk86_read('export'); uk86_import('libraries.uk86excel'); $excel_obj = new Uk86Excel(); $excel_data = array(); //设置样式 $excel_obj->uk86_setStyle(array('id' => 's_title', 'Font' => array('FontName' => '宋体', 'Size' => '12', 'Bold' => '1'))); //header $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_no')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_store')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_buyer')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_xtimd')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_count')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_yfei')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_paytype')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_state')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_storeid')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_buyerid')); $excel_data[0][] = array('styleid' => 's_title', 'data' => L('exp_od_bemail')); //data foreach ((array) $data as $k => $v) { $tmp = array(); $tmp[] = array('data' => 'NC' . $v['order_sn']); $tmp[] = array('data' => $v['store_name']); $tmp[] = array('data' => $v['buyer_name']); $tmp[] = array('data' => date('Y-m-d H:i:s', $v['add_time'])); $tmp[] = array('format' => 'Number', 'data' => uk86_ncPriceFormat($v['order_amount'])); $tmp[] = array('format' => 'Number', 'data' => uk86_ncPriceFormat($v['shipping_fee'])); $tmp[] = array('data' => uk86_orderPaymentName($v['payment_code'])); $tmp[] = array('data' => uk86_orderState($v)); $tmp[] = array('data' => $v['store_id']); $tmp[] = array('data' => $v['buyer_id']); $tmp[] = array('data' => $v['buyer_email']); $excel_data[] = $tmp; } $excel_data = $excel_obj->uk86_charset($excel_data, CHARSET); $excel_obj->uk86_addArray($excel_data); $excel_obj->uk86_addWorksheet($excel_obj->uk86_charset(L('exp_od_order'), CHARSET)); $excel_obj->uk86_generateXML($excel_obj->uk86_charset(L('exp_od_order'), CHARSET) . $_GET['curpage'] . '-' . date('Y-m-d-H', time())); }
/** * 物流跟踪 */ public function search_deliverOp() { Uk86Language::uk86_read('member_member_index'); $lang = Uk86Language::uk86_getLangContent(); $order_sn = $_GET['order_sn']; if (!is_numeric($order_sn)) { uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), '', 'html', 'error'); } $model_order = Model('order'); $condition['order_sn'] = $order_sn; $condition['store_id'] = $_SESSION['store_id']; $order_info = $model_order->getOrderInfo($condition, array('order_common', 'order_goods')); if (empty($order_info) || $order_info['shipping_code'] == '') { uk86_showMessage('未找到信息', '', 'html', 'error'); } $order_info['state_info'] = uk86_orderState($order_info); Tpl::output('order_info', $order_info); //卖家发货信息 $daddress_info = Model('daddress')->getAddressInfo(array('address_id' => $order_info['extend_order_common']['daddress_id'])); Tpl::output('daddress_info', $daddress_info); //取得配送公司代码 $express = uk86_rkcache('express', true); Tpl::output('e_code', $express[$order_info['extend_order_common']['shipping_express_id']]['e_code']); Tpl::output('e_name', $express[$order_info['extend_order_common']['shipping_express_id']]['e_name']); Tpl::output('e_url', $express[$order_info['extend_order_common']['shipping_express_id']]['e_url']); Tpl::output('shipping_code', $order_info['shipping_code']); self::profile_menu('search', 'search'); Tpl::showpage('store_deliver.detail'); }
/** * 取得订单列表(所有) * @param unknown $condition * @param string $pagesize * @param string $field * @param string $order * @param string $limit * @param unknown $extend 追加返回那些表的信息,如array('order_common','order_goods','store') * @return Ambigous <multitype:boolean Ambigous <string, mixed> , unknown> */ public function getOrderList($condition, $pagesize = '', $field = '*', $order = 'order_id desc', $limit = '', $extend = array(), $master = false) { $list = $this->table('order')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->master($master)->select(); if (empty($list)) { return array(); } $order_list = array(); foreach ($list as $order) { if (isset($order['order_state'])) { $order['state_desc'] = uk86_orderState($order); } if (isset($order['payment_code'])) { $order['payment_name'] = uk86_orderPaymentName($order['payment_code']); } if (!empty($extend)) { $order_list[$order['order_id']] = $order; } } if (empty($order_list)) { $order_list = $list; } //追加返回订单扩展表信息 if (in_array('order_common', $extend)) { $order_common_list = $this->getOrderCommonList(array('order_id' => array('in', array_keys($order_list)))); foreach ($order_common_list as $value) { $order_list[$value['order_id']]['extend_order_common'] = $value; $order_list[$value['order_id']]['extend_order_common']['reciver_info'] = @unserialize($value['reciver_info']); $order_list[$value['order_id']]['extend_order_common']['invoice_info'] = @unserialize($value['invoice_info']); } } //追加返回店铺信息 if (in_array('store', $extend)) { $store_id_array = array(); foreach ($order_list as $value) { if (!in_array($value['store_id'], $store_id_array)) { $store_id_array[] = $value['store_id']; } } $store_list = Model('store')->getStoreList(array('store_id' => array('in', $store_id_array))); $store_new_list = array(); foreach ($store_list as $store) { $store_new_list[$store['store_id']] = $store; } foreach ($order_list as $order_id => $order) { $order_list[$order_id]['extend_store'] = $store_new_list[$order['store_id']]; } } //追加返回买家信息 if (in_array('member', $extend)) { foreach ($order_list as $order_id => $order) { $order_list[$order_id]['extend_member'] = Model('member')->getMemberInfoByID($order['buyer_id']); } } //追加返回商品信息 if (in_array('order_goods', $extend)) { //取商品列表 $order_goods_list = $this->getOrderGoodsList(array('order_id' => array('in', array_keys($order_list)))); if (!empty($order_goods_list)) { foreach ($order_goods_list as $value) { $order_list[$value['order_id']]['extend_order_goods'][] = $value; } } else { $order_list[$value['order_id']]['extend_order_goods'] = array(); } } return $order_list; }
echo count($order_info['extend_order_goods']); ?> </strong>种商品</span> <?php } ?> </dt> <dd><span class="order-date">下单时间:<?php echo date('Y-m-d H:i:s', $order_info['add_time']); ?> </span><span class="ncm-order-price">订单金额:<em>¥<?php echo $order_info['order_amount']; ?> </em></span></dd> <dd><span class="order-state">订单状态:<?php echo strip_tags(uk86_orderState($order_info)); ?> <?php if ($order_info['if_deliver']) { ?> <a href='index.php?act=member_order&op=search_deliver&order_id=<?php echo $order_info['order_id']; ?> &order_sn=<?php echo $order_info['order_sn']; ?> ' target="_blank"><i class="icon-truck"></i>查看物流</a> <?php } ?> </span> </dd>