zoukankan      html  css  js  c++  java
  • ECSHOP2.72 前台调用 定单号,及收货人,快递号

    原来的index_get_invoice_query函数调用时没有调用收货人和收货的省及城市,稍微做一下改进就可以实现在首页订单调用中显示收货人及收货的地区

    把index.php中的

    /**
    * 调用发货单查询
    *
    * @access private
    * @return array
    */
    function index_get_invoice_query()
    {
    $sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
    ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' .
    " WHERE invoice_no > '' AND shipping_status = " . SS_SHIPPED .
    ' ORDER BY shipping_time DESC LIMIT 10';
    $all = $GLOBALS['db']->getAll($sql);
    
    foreach ($all AS $key => $row)
    {
    $plugin = ROOT_PATH . 'includes/modules/shipping/' . $row['shipping_code'] . '.php';
    
    if (file_exists($plugin))
    {
    include_once($plugin);
    
    $shipping = new $row['shipping_code'];
    $all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']);
    }
    }
    
    clearstatcache();
    
    return $all;
    }

    改成:

    /**
    * 调用发货单查询
    *
    * @access private
    * @return array
    */
    function index_get_invoice_query()
    {
    $sql = 'SELECT o.order_sn, o.consignee, o.invoice_no, s.shipping_code,r1.region_name  as provice-name,r2.region_name as city_name FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
    ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' .
    ' LEFT JOIN ' . $GLOBALS['ecs']->table('region') . ' AS r1 ON r1.region_id = o.province' .
    ' LEFT JOIN ' . $GLOBALS['ecs']->table('region') . ' AS r2 ON r2.region_id = o.city' .
    " WHERE invoice_no > '' AND shipping_status = " . SS_SHIPPED .
    ' ORDER BY shipping_time DESC LIMIT 10';
    $all = $GLOBALS['db']->getAll($sql);
    
    foreach ($all AS $key => $row)
    {
    $plugin = ROOT_PATH . 'includes/modules/shipping/' . $row['shipping_code'] . '.php';
    
    if (file_exists($plugin))
    {
    include_once($plugin);
    
    $shipping = new $row['shipping_code'];
    $all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']);
    }
    }
    
    clearstatcache();
    
    return $all;
    }

    这样就可以在invoice_list.lbi中增加显示收货人及收货地址

  • 相关阅读:
    mingW与cygwin
    Ruby on Rails 和 J2EE:两者能否共存?
    嵌入式Linux学习笔记(一) 启航、计划和内核模块初步体验
    嵌入式Linux学习笔记(六) 上位机QT界面实现和通讯实现
    嵌入式Linux问题总结(一) Ubuntu常用命令和编译问题解决方法
    嵌入式Linux学习笔记(五) 通讯协议制定和下位机代码实现
    嵌入式Linux学习笔记(四) 设备树和UART驱动开发
    嵌入式Linux学习笔记(三) 字符型设备驱动--LED的驱动开发
    嵌入式Linux学习笔记(二) 交叉编译环境和Linux系统编译、下载
    记录嵌入式面试的流程
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2814831.html
Copyright © 2011-2022 走看看