在导单的新增一个商家备注
2016-07-07 15:17 来源:www.chinab4c.com 作者:ecshop专家
我用这个来导单的,想在导出的excel里有个商家备注 <?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\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); ?> |
回答:
你直接取得postscript就可以了 |
最近更新
常用插件
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
ecshop热门问答
ecshop热门资料
ecshopcode
ecshop锁定
ecshop老婆
ecshopsitmaps
ecshopECshop只能打开首页
ecshop中将
ecshop数码
ecshop登陆后台出错
ecshop显示设置
ecshop会员登陆
ecshop网络
ecshopold
ecshop热心人
ecshop存储
ecshop地方的
ecshop主意
https502
ecshop被黑
ecshop显示会员价格
ecshop校验
ecshopanything
ecshop只能评价一次
ecshop排版
ecshop会员留言
ecshop版面設置
ecshop切割
ecshop程序设计
ecshop仿京东
ecshop电脑配件
ecshop图片切换