//数据导出
protected function dao($db,$where,$join,$field){
$data = M($db)->join($join)->where($where)->field($field)->order('stime desc')->select();
date_default_timezone_set("PRC");
Header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
Header("Accept-Ranges:bytes");
Header("Content-Disposition:attachment;filename=".date('YmdHis').".xls");
Header("Pragma: no-cache");
Header("Expires: 0");
$tx='配送信息';
$str.=$tx."
";
$str.= "ID"." ";
$str.= "微信流水号"." ";
$str.= "微信手机号"." ";
$str.= "收货人"." ";
$str.= "联系方式"." ";
$str.= "收货地址"." ";
$str.= "参团类型"." ";
$str.= "预约成功时间"." ";
$str.= "参与人数"." ";
$str.= "备注"."
";
$info = iconv("UTF-8","GBK",$str);
echo $info;
$type = array('团员','团长');
foreach($data as $arr){
$str2.= trim(iconv("UTF-8","GBK",$arr['id']))." ";
$str2.= mb_convert_encoding('`'.$arr['wxoid'],"GBK","UTF-8")." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['wphone']))." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['name']))." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['phone']))." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['city'].$arr['address']))." ";
$str2.= trim(iconv("UTF-8","GBK",$type[$arr['type']]))." ";
$str2.= mb_convert_encoding(date("Y-m-d H:i:s",$arr['stime']),"GBK","UTF-8")." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['nowman']))." ";
$str2.= trim(iconv("UTF-8","GBK",$arr['remark']))."
";
}
echo $str2;
}