ECSHOP2.72 前台调用 定单号,及收货人,快递号
时间:2024年01月31日
/来源:网络
/编辑:佚名
原来的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中增加显示收货人及收货地址
把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中增加显示收货人及收货地址
新闻资讯 更多
热门文章
- 178Moban源码谈谈免费源码与收费源码的区别
- 2帝国CMS忘记后台登陆用户名、密码、认证码的解决方法
- 3帝国CMS(EmpireCMS) v7.5后台任意代码执行漏洞及具体修复方法
- 4帝国CMS和WordPress 哪个好?哪个适合建站?
- 5如何解决Discuz的密码错误次数过多请15分钟后登陆的问题
- 6帝国cms灵动标签取得内容和栏目链接地址
- 7emlog pro 注册码“开心”教程(如果有一天,emlog官方版 或者 emlog免费版 跑路了,那用户怎么办?)
- 8织梦CMS在nginx下设置伪静态方法(附nginx伪静态规则)
- 9帝国cms后台登录出现”您还未登录”怎么解决?
- 10帝国cms7.5忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法