ecshop“发货查询”中加入收货人、收货地址、发货时间、配送方式

1、修改 index.php 的 index_get_invoice_query() 函数部分将

    $sql = ‘SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ‘ . $GLOBALS[‘ecs’]->table(‘order_info’) . ‘ AS o’ .

修改为

    $sql = ‘SELECT o.order_sn, o.invoice_no, s.shipping_code,o.consignee, from_unixtime(o.shipping_time,\’%Y-%m-%d %H:%i:%s’) as shippingtime,o.shipping_name, r.region_name AS province 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 r ON r.region_id = o.province’ .

2、然后修改模板文件library/invoice_query.lbi在

    {$lang.order_number} {$invoice.order_sn}<br />{$lang.consignment} {$invoice.invoice_no}<br />

下面增加

    <br>收货人:{$invoice.consignee}<br>收货地址:{$invoice.province}<br>发货时间:{$invoice.shippingtime}<br>配送方式:{$invoice.shipping_name}

3、以上方法是完全显示收货人的全称,如果想要以“王**”、“李**”的形式来显示的话,继续进行下面修改继续修改修改index.php的 index_get_invoice_query() 函数部分在

    $all[$key][‘invoice_no’] = $shipping->query((string)$row[‘invoice_no’]);

下面增加一行

    $all[$key][‘consignee’]=sub_str($row[‘consignee’], 1, false).’**’;

修改提示:订单号调用o.order_sn字段发货单号调用o.invoice_no字段收货人调用o.consignee字段收货地址调用r.region_name AS province字段发货时间from_unixtime(o.shipping_time,\’%Y-%m-%d %H:%i:%s’) as shippingtime字段配送方式o.shipping_name字段如果想要以“王四*”则调用

    $all[$key][‘consignee’]=sub_str($row[‘consignee’], 2, false).’*’;

如果想要以“王**”则调用

    $all[$key][‘consignee’]=sub_str($row[‘consignee’], 1, false).’**’;

真凉爽啊!青山绿水映入我的眼中,景色怡人啊!

ecshop“发货查询”中加入收货人、收货地址、发货时间、配送方式

相关文章:

你感兴趣的文章:

标签云: