在导出订单的时候怎么加个商家备注?
2016-07-07 15:17 来源:www.chinab4c.com 作者:ecshop专家
在导出订单的时候怎么加个商家备注? 商家备注在数据库的哪个表里? |
回答:
<?php define('IN_ECS', true); include ('includes/init.php'); $filename='orderexcel'; header("Content-type: application/vnd.ms-excel; charset=gbk"); header("Content-Disposition: attachment; filename=$filename.xls"); $data='订单号'."\t"; $data.='购货人'."\t"; $data.='支付方式'."\t"; $data.='配送方式'."\t"; $data.='收货人'."\t"; $data.='收货地址'."\t"; $data.='电话'."\t"; $data.='下单时间'."\t"; $data.='商务备注'."\t"; $data.='商家名称'."\t\n"; $sql="select o.order_sn,o.c**ignee,o.address,o.tel,o.add_time,o.shipping_name,o.pay_name,g.goods_name,g.goods_attr,g.goods_number,u.user_name from". $GLOBALS['ecs']->table('order_info'). " as o left join " . $GLOBALS['ecs']->table('users')." as u on o.user_id=u.user_id "."left join". $GLOBALS['ecs']->table('order_goods')." as g on o.order_id=g.order_id "; $res=$db->getAll($sql); //print_r($res); //echo $sql; while (!empty($res)) { foreach ($res as $key=>$var) { $res1[$key]['add_time']=''; $res1[$key]['goods']=''; $res1[$key]['address']=''; $res1[$key]['c**ignee']=''; $res1[$key]['pay_name']=''; $res1[$key]['user_name']=''; $res1[$key]['order_sn']=''; $res1[$key]['tel']=''; $res1[$key]['shipping_name']=''; $a=$var['order_sn']; foreach ($res as $keys=>$vars) { if($a==$vars['order_sn']) { $res1[$key]['order_sn']=$vars['order_sn']; $res1[$key]['user_name']=$vars['user_name']; $res1[$key]['pay_name']=$vars['pay_name']; $res1[$key]['shipping_name']=$vars['shipping_name']; $res1[$key]['c**ignee']=$vars['c**ignee']; $res1[$key]['address']=$vars['address']; $vars['goods_attr']= trim($vars['goods_attr']); $res1[$key]['goods'].="$vars[goods_name] $vars[goods_attr] $vars[goods_number]"."\n"; $res1[$key]['tel'] .= $vars['tel']; $res1[$key]['add_time']=date('y-m-d h:i:s',$vars['add_time']); unset ($res[$keys]); } } } } foreach ($res1 as $key =>$var) { $data.=$var['order_sn']."\t"; $data.=$var['user_name']."\t"; $data.=$var['pay_name']."\t"; $data.=$var['shipping_name']."\t"; $data.=$var['c**ignee']."\t"; $data.=$var['address']."\t"; $data.=$var['tel']."\t"; $data.=$var['add_time']."\t"; $data.="\""; $data.=$var['goods']."\""; $data.="\t\n"; } if (EC_CHARSET != 'gbk') { echo ecs_iconv(EC_CHARSET, 'gbk', $data) . "\t"; } else { echo $data. "\t"; } //print_r($res1); ?> 怎么加一个商家备注? |
<?php define('IN_ECS', true); include ('includes/init.php'); $filename='orderexcel'; header("Content-type: application/vnd.ms-excel; charset=gbk"); header("Content-Disposition: attachment; filename=$filename.xls"); $data='订单号'."\t"; $data.='购货人'."\t"; $data.='支付方式'."\t"; $data.='配送方式'."\t"; $data.='收货人'."\t"; $data.='收货地址'."\t"; $data.='电话'."\t"; $data.='下单时间'."\t"; $data.='商务备注'."\t"; $data.='商家名称'."\t\n"; $sql="select o.order_sn,o.c**ignee,o.address,o.tel,o.add_time,o.shipping_name,o.pay_name,g.goods_name,g.goods_attr,g.goods_number,u.user_name from". $GLOBALS['ecs']->table('order_info'). " as o left join " . $GLOBALS['ecs']->table('users')." as u on o.user_id=u.user_id "."left join". $GLOBALS['ecs']->table('order_goods')." as g on o.order_id=g.order_id "; $res=$db->getAll($sql); //print_r($res); //echo $sql; while (!empty($res)) { foreach ($res as $key=>$var) { $res1[$key]['add_time']=''; $res1[$key]['goods']=''; $res1[$key]['address']=''; $res1[$key]['c**ignee']=''; $res1[$key]['pay_name']=''; $res1[$key]['user_name']=''; $res1[$key]['order_sn']=''; $res1[$key]['tel']=''; $res1[$key]['shipping_name']=''; $a=$var['order_sn']; foreach ($res as $keys=>$vars) { if($a==$vars['order_sn']) { $res1[$key]['order_sn']=$vars['order_sn']; $res1[$key]['user_name']=$vars['user_name']; $res1[$key]['pay_name']=$vars['pay_name']; $res1[$key]['shipping_name']=$vars['shipping_name']; $res1[$key]['c**ignee']=$vars['c**ignee']; $res1[$key]['address']=$vars['address']; $vars['goods_attr']= trim($vars['goods_attr']); $res1[$key]['goods'].="$vars[goods_name] $vars[goods_attr] $vars[goods_number]"."\n"; $res1[$key]['tel'] .= $vars['tel']; $res1[$key]['add_time']=date('y-m-d h:i:s',$vars['add_time']); unset ($res[$keys]); } } } } foreach ($res1 as $key =>$var) { $data.=$var['order_sn']."\t"; $data.=$var['user_name']."\t"; $data.=$var['pay_name']."\t"; $data.=$var['shipping_name']."\t"; $data.=$var['c**ignee']."\t"; $data.=$var['address']."\t"; $data.=$var['tel']."\t"; $data.=$var['add_time']."\t"; $data.="\""; $data.=$var['goods']."\""; $data.="\t\n"; } if (EC_CHARSET != 'gbk') { echo ecs_iconv(EC_CHARSET, 'gbk', $data) . "\t"; } else { echo $data. "\t"; } //print_r($res1); ?> 怎么再加一个商家备注的? |
你确认你问的是“导出订单”而不是“导出商品” |
商家备注这个字段应该是在 商品表里 ecs_goods,字段名是 seller_note |
就是在这个表加一个商家备注 <?php define('IN_ECS', true); include ('includes/init.php'); $filename='orderexcel'; header("Content-type: application/vnd.ms-excel; charset=gbk"); header("Content-Disposition: attachment; filename=$filename.xls"); $data='订单号'."\t"; $data.='购货人'."\t"; $data.='支付方式'."\t"; $data.='配送方式'."\t"; $data.='收货人'."\t"; $data.='收货地址'."\t"; $data.='电话'."\t"; $data.='下单时间'."\t"; $data.='商品名称'."\t"; $data.='商品备注'."\t\n"; $sql="select o.order_sn,o.c**ignee,o.address,o.tel,o.add_time,o.shipping_name,o.pay_name,g.goods_name,g.goods_attr,g.goods_number,u.user_name from". $GLOBALS['ecs']->table('order_info'). " as o left join " . $GLOBALS['ecs']->table('users')." as u on o.user_id=u.user_id "."left join". $GLOBALS['ecs']->table('order_goods')." as g on o.order_id=g.order_id "; $res=$db->getAll($sql); //print_r($res); //echo $sql; while (!empty($res)) { foreach ($res as $key=>$var) { $res1[$key]['add_time']=''; $res1[$key]['goods']=''; $res1[$key]['address']=''; $res1[$key]['c**ignee']=''; $res1[$key]['pay_name']=''; $res1[$key]['user_name']=''; $res1[$key]['order_sn']=''; $res1[$key]['tel']=''; $res1[$key]['shipping_name']=''; $a=$var['order_sn']; foreach ($res as $keys=>$vars) { if($a==$vars['order_sn']) { $res1[$key]['order_sn']=$vars['order_sn']; $res1[$key]['user_name']=$vars['user_name']; $res1[$key]['pay_name']=$vars['pay_name']; $res1[$key]['shipping_name']=$vars['shipping_name']; $res1[$key]['c**ignee']=$vars['c**ignee']; $res1[$key]['address']=$vars['address']; $vars['goods_attr']= trim($vars['goods_attr']); $res1[$key]['goods'].="$vars[goods_name] $vars[goods_attr] $vars[goods_number]"."\n"; $res1[$key]['tel'] .= $vars['tel']; $res1[$key]['add_time']=date('y-m-d h:i:s',$vars['add_time']); unset ($res[$keys]); } } } } foreach ($res1 as $key =>$var) { $data.=$var['order_sn']."\t"; $data.=$var['user_name']."\t"; $data.=$var['pay_name']."\t"; $data.=$var['shipping_name']."\t"; $data.=$var['c**ignee']."\t"; $data.=$var['address']."\t"; $data.=$var['tel']."\t"; $data.=$var['add_time']."\t"; $data.="\""; $data.=$var['goods']."\""; $data.="\t\n"; } if (EC_CHARSET != 'gbk') { echo ecs_iconv(EC_CHARSET, 'gbk', $data) . "\t"; } else { echo $data. "\t"; } //print_r($res1); ?> |
最近更新
常用插件
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
ecshop热门问答
ecshop热门资料
ecshop分类名称长度
ecshop404错误页面
mongodb游标
ecshop后台扩展分类
ecshop部署
ecshop计划任务
ecshop网站名
ecshopdisplay
ecmall中ajax验证
ecshop电脑硬盘
ecshop栏目显示
ecshopCSV
ecshop遗漏
ecshop保持登陆
ecshop错乱
ecshop前途
ecshopmember
ecshop产品收录
ecshop团购说明
ecshop具体步骤
ecshopfopen
ecshopmethod
ecshop首页广告
ecshop手机模版
ecshop帮忙
ecshop等级
ecshopusers
ecshopopera
ecshop数据库结构说明
ecshop用户名称