购买记录如何显示收货地址和收货人姓名呀。请帮忙看看
2016-07-07 15:01 来源:www.chinab4c.com 作者:ecshop专家
/* 商品购买记录 */ $sql = 'SELECT u.user_name, og.goods_sn,og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' . 'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $arr['id'] . ' ORDER BY oi.add_time DESC LIMIT 5'; $bought_notes = $GLOBALS['db']->getAll($sql); foreach ($bought_notes as $key => $val) { $bought_notes[$key]['add_time'] = local_date("Y-m-d G:i:s", $val['add_time']); } $sql = 'SELECT count(*) ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' . 'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $arr['id']; $count = $GLOBALS['db']->getOne($sql); |
回答:
order_info表中有收货人,收货地址~你查询的时候~把他查询出来就行了。 $sql = 'SELECT u.user_name, og.goods_sn,og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status,oi.c**ignee,oi.address ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' . 'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $arr['id'] . ' ORDER BY oi.add_time DESC LIMIT 5'; $bought_notes = $GLOBALS['db']->getAll($sql); |
到时认真看看.... |
最近更新
常用插件
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
ecshop热门问答
ecshop热门资料
ecshop铁通
ecshop末尾
ecshop二级分类加图标
ecshop图片本地化
ecshopconsignee
ecshopcps
ecshopTable
ecshop儿童服装
ecshop项不能
ecshop垃圾
ecshop点击率排序
ecshop内容格式错误
ecshop限时抢购
ecshop流动电话
ecshop普通
ecshop多语言
ecshopechsop
ecshop2.7.0
ecshop帝国
ecshophello
ecshop百团大战
ecshop优势网络
ecshop专题功能
ecshopexport
ecshop后台不能上传图片
ecshop附近
ecshop设为首页
ecshop评论功能
ecshopForbidden
ecshopval