婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網站建設 > 建站知識 > 織夢dedecms訂單列表導出到excel表的代碼教程

織夢dedecms訂單列表導出到excel表的代碼教程

POST TIME:2021-05-23 02:14

織夢dedecms訂單列表導出到excel表導出效果

使用說明

可選擇導出指定的織夢訂單,不選就是導出全部

導出的excle文件按當前時間命名

導出的excel文件請用wps軟件打開,office軟件下可能會亂碼

1、打開 /dede/shops_operations.php 找到

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 "<table><tr>";

echo "<th>訂單號</th>";

echo "<th>商品名稱</th>";

echo "<th>單價(元/單位)</th>";

echo "<th>數量</th>";

echo "<th>支付方式</th>";

echo "<th>配送費</th>";

echo "<th>購買時間</th>";

echo "<th>收貨人</th>";

echo "<th>地址</th>";

echo "<th>郵編</th>";

echo "<th>聯系電話</th>";

echo "<th>郵箱</th>";

echo "<th>留言</th>";

echo "<th>合計(元)</th>";

echo "<th>狀態</th>";

echo "</tr>";

$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 dede_shops_orders as o left join dede_shops_products as p on o.oid=p.oid left join dede_shops_delivery as d on d.pid=o.pid LEFT JOIN dede_shops_userinfo AS u ON o.oid=u.oid $wh";

$dsql->SetQuery($sql);

$dsql->Execute('t');

while($arr = $dsql->GetArray('t'))

{

echo "<tr>";

echo "<td>".$arr['oid']."</td>";//訂單號

echo "<td>".$arr['title']."</td>";//商品名稱

echo "<td>".$arr['uprice']."</td>";//單價

echo "<td>".$arr['cartcount']."</td>";//數量 www.dede58.com織夢模板

echo "<td>".GetsType($arr['paytype'])."</td>";//支付方式

echo "<td>".$arr['dname']."費用:".$arr['dprice']."元</td>";//配送費

echo "<td>".GetDateTimeMk($arr['stime'])."</td>";//購買時間

echo "<td>".$arr['consignee']."</td>";//收貨人

echo "<td>".$arr['address']."</td>";//地址

echo "<td>".$arr['zip']."</td>";//郵編

echo "<td>".$arr['tel']."</td>";//聯系電話

echo "<td>".$arr['email']."</td>";//郵箱

echo "<td>".$arr['des']."</td>";//留言

echo "<td>".$arr['priceCount']."</td>";//合計

echo "<td>".GetSta($arr['state'])."</td>";//狀態

echo "</tr>";

}

echo "</table>";

exit();

}

 

2、打開 /dede/shops_operations.htm 找到

<input type="button" name="b9" value="設為已完成狀態" class='np coolbg' onClick="OkSel();">

 

在它下面加入

<input type="button" name="b9" value="導出選中訂單" class='np coolbg' onClick="OutSel();">

 

繼續找到

function PushSel(){

在它上面加入

function OutSel()

{

var nid = getCheckboxItem();

location.href = "shops_operations.php?dopost=out&nid="+nid;

}

 

完成,看清楚教程,有的是在下面加入有的是在上面加入的。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 工布江达县| 阳山县| 望奎县| 东乡| 太谷县| 平邑县| 齐齐哈尔市| 大宁县| 永寿县| 南澳县| 琼中| 凤凰县| 读书| 象山县| 遂昌县| 进贤县| 灵寿县| 楚雄市| 延吉市| 湘西| 博白县| 太湖县| 樟树市| 枞阳县| 义乌市| 建德市| 蕲春县| 霞浦县| 张家口市| 乌海市| 庆城县| 淅川县| 双流县| 鹿邑县| 株洲市| 沙雅县| 海原县| 秦皇岛市| 綦江县| 兴隆县| 唐河县|