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

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

  1. $sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
修改为

  1. $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' .
紧接着在

  1. ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' .
这行代码下面增加一行

  1. ' LEFT JOIN ' . $GLOBALS['ecs']->table('region') . ' AS r ON r.region_id = o.province' .
2、然后修改模板文件 library/invoice_query.lbi



  1. {$lang.order_number} {$invoice.order_sn}<br />
  2. {$lang.consignment} {$invoice.invoice_no}<br />
下面增加

  1. <br>收货人:{$invoice.consignee}
  2. <br>收货地址:{$invoice.province}
  3. <br>发货时间:{$invoice.shippingtime}
  4. <br>配送方式:{$invoice.shipping_name}
3、以上方法是完全显示收货人的全称,如果想要以“王**”、“李**”的形式来显示的话,继续进行下面修改继续修改修改index.php的 index_get_invoice_query() 函数部分


  1. $all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']);
下面增加一行

  1. $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字段

如果想要以“王四*”则调用
  1. $all[$key]['consignee']=sub_str($row['consignee'], 2, false).'*';
如果想要以
“王**”则调用
  1. $all[$key]['consignee']=sub_str($row['consignee'], 1, false).'**';
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值