订单列表中,如何列出办事处的名称.??

2016-07-07 15:00 来源:www.chinab4c.com 作者:ecshop专家

如题:
订单列表中,如何列出办事处的名称.??谢谢..

回答:
好象回答过这个问题,还写出了sql语句

$sql = "SELECT o.order_id, o.order_sn,o.agency_id, o.add_time, o.order_status, o.shipping_status, o.order_amount, o.money_paid,ag.agency_name," .
"o.pay_status, o.c**ignee, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .
"(" . order_amount_field('o.') . ") AS total_fee, " .
"IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer ".
" FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
" LEFT JOIN " .$GLOBALS['ecs']->table('users')." AS u ON u.user_id=o.user_id LEFT JOIN ". $GLOBALS['ecs']->table('agency') ." AS ag ON o.agency_id = ag.agency_id". $where .
" ORDER BY $filter[sort_by] $filter[sort_order] ".
" LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";



前台用{$order.agency_name} 调用成功,谢谢大家.