function get_order($type)
 {
     $_GET['type'] = $type;
     $model_order =& m('order');
     $extm_order =& m('orderextm');
     $con = array(array('field' => 'status', 'name' => 'type', 'handler' => 'order_status_translator'), array('field' => 'order_sn'));
     $conditions = $this->_get_query_conditions($con);
     $store_mod =& m("store");
     $orders = $model_order->findAll(array('conditions' => "buyer_id=" . $this->visitor->get('user_id') . "{$conditions}", 'fields' => 'this.*', 'limit' => 4, 'order' => 'add_time DESC', 'include' => array('has_ordergoods')));
     foreach ($orders as $k => $val) {
         $orders[$k]['count'] = count($val['order_goods']);
         $first_goods = reset($val['order_goods']);
         $orders[$k]['img'] = $first_goods['goods_image'];
         $orders[$k]['gid'] = $first_goods['goods_id'];
     }
     foreach ($orders as $k => $val) {
         $cache_server =& cache_server();
         if ($val['status'] == 30) {
             $key = "express_" . $this->visitor->get('user_id') . "_" . $val['order_id'];
             $shipping = $cache_server->get($key);
             if ($shipping === false) {
                 $shipping = express_info($val['shipping_name'], $val['invoice_no']);
                 $shipping = json_decode($shipping, true);
                 $cache_server->set($key, $shipping, 1800);
             }
             $orders[$k]['wuliu'] = $shipping['data']['0'];
         }
     }
     return $orders;
 }
 function wuliu()
 {
     $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0;
     $cache_server =& cache_server();
     $key = "page_of_order_wuliu_" . $this->visitor->get('user_id') . "_" . $val['order_id'];
     $shipping = $cache_server->get($key);
     $model_order =& m('order');
     $express =& m("express");
     $order_info = $model_order->get(array('fields' => "*, order.add_time as order_add_time", 'conditions' => "order_id={$order_id} AND buyer_id=" . $this->visitor->get('user_id'), 'join' => 'belongs_to_store'));
     $shipp = $order_info['shipping_name'];
     $info = $express->get("express_name='{$shipp}'");
     $order_info['express_phone'] = $info['express_phone'];
     if (!$order_info) {
         $this->show_warning('no_such_order');
         return;
     }
     $order_type =& ot($order_info['extension']);
     $order_detail = $order_type->get_order_detail($order_id, $order_info);
     if ($shipping === false) {
         $shipping = express_info($shipping, $order_info['invoice_no']);
         $shipping = json_decode($shipping, true);
         $cache_server->set($key, $shipping, 1440);
     }
     $order_type =& ot($order_info['extension']);
     $order_detail = $order_type->get_order_detail($order_id, $order_info);
     //       foreach ($order_detail['data']['goods_list'] as $key => &$goods)
     //       {
     //           empty($goods['goods_image']) && $order_detail['data']['goods_list'][$key]['goods_image'] = Conf::get('default_goods_image');
     //           $goods['goods_amount']=$goods['quantity']*$goods['price'];
     //       }
     /* 当前位置 */
     $this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('my_order'), 'index.php?app=buyer_order', "物流中心");
     /* 当前用户中心菜单 */
     $this->_curitem('my_order');
     $this->assign('order', $order_info);
     $this->assign($order_detail['data']);
     $this->assign("wuliu", $shipping['data']);
     $this->_config_seo('title', Lang::get('member_center') . ' - ' . "物流中心");
     if (is_wap()) {
         $this->assign("title", "物流中心");
     }
     $this->display("pr_order.wuliu.html");
 }