可选择导出指定的订单,不选就是导出全部 导出的excle文件按当前时间命名 导出的excel文件请用wps软件打开,office软件下可能会乱码 1、打开 /dede/shops_operations.php 找到 1 elseif($dopost==del...
可选择导出指定的订单,不选就是导出全部
导出的excle文件按当前时间命名
导出的excel文件请用wps软件打开,office软件下可能会乱码
1、打开 /dede/shops_operations.php 找到
1 |
else if ($dopost == 'delete') |
在它上面加入
else if ($dopost == 'out')
{
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=".date("Y-m-d-H-i-s").".xls"); echo " "; echo "订单号 | "; echo "商品名称 | "; echo "单价(元/单位) | "; echo "数量 | "; echo "支付方式 | "; echo "配送费 | "; echo "购买时间 | "; echo "收货人 | "; echo "地址 | "; echo "邮编 | "; echo "联系电话 | "; echo "邮箱 | "; echo "留言 | "; echo "合计(元) | "; echo "状态 | "; echo " ";
$wh = ''; if( !empty($nid) )
{
$nids = explode('`',$nid); foreach($nids as $n)
{ if($wh=='') $wh = " WHERE o.oid='$n' "; else $wh .= " OR o.oid='$n' ";
}
}
$sql = "SELECT o.*,p.title,p.price as uprice,d.dname,u.* FROM xjq_shops_orders as o left join xjq_shops_products as p on o.oid=p.oid left join xjq_shops_delivery as d on d.pid=o.pid LEFT JOIN xjq_shops_userinfo AS u ON o.oid=u.oid $wh";
$dsql->SetQuery($sql);
$dsql->Execute('t'); while($arr = $dsql->GetArray('t'))
{ echo ""; echo "".$arr['oid']." | ";//订单号
echo "".$arr['title']." | ";//商品名称
echo "".$arr['uprice']." | ";//单价
echo "".$arr['cartcount']." | ";//数量
echo "".GetsType($arr['paytype'])." | ";//支付方式
echo "".$arr['dname']."费用:".$arr['dprice']."元 | ";//配送费
echo "".GetDateTimeMk($arr['stime'])." | ";//购买时间
echo "".$arr['consignee']." | ";//收货人
echo "".$arr['address']." | ";//地址
echo "".$arr['zip']." | ";//邮编
echo "".$arr['tel']." | ";//联系电话
echo "".$arr['email']." | ";//邮箱
echo "".$arr['des']." | ";//留言
echo "".$arr['priceCount']." | ";//合计
echo "".GetSta($arr['state'])." | ";//状态
echo " ";
} echo " "; exit();
}
|
2、打开 /dede/shops_operations.htm 找到
在它下面加入
继续找到
在它上面加入
function OutSel(){ var nid = getCheckboxItem();
location.href = "shops_operations.php?dopost=out&nid="+nid;
}
|
完成,看清楚教程,有的是在下面加入有的是在上面加入的。
修改到此结束,需要此功能的小伙伴赶紧试试吧。
Pbootcms问题解决
请点击在线联系我们【点击咨询解决问题】 如果您有任何Pbootcms问题,我们将免费为您写解决教程!