...
|
...
|
@@ -421,7 +421,11 @@ class AdminCommonController extends AdminBaseController |
|
|
}
|
|
|
$file_url = ROOT_PATH . '/public/upload/export/'.$file_name;
|
|
|
$objWrite->save($file_url);
|
|
|
chmod($file_url, 0777);
|
|
|
|
|
|
$sys = $this->getOperateSys();
|
|
|
if($sys == 'Linux'){
|
|
|
chmod($file_url, 0777);//适用于linux
|
|
|
}
|
|
|
//相对路径
|
|
|
$url = 'upload/export/'.$file_name;
|
|
|
return $url;
|
...
|
...
|
@@ -593,7 +597,6 @@ class AdminCommonController extends AdminBaseController |
|
|
// }
|
|
|
|
|
|
//如果不要下载,下面这段删掉即可,如需返回压缩包下载链接,只需 return $zipName;
|
|
|
|
|
|
if($sys == 'Windows'){
|
|
|
//中文导出需要转码
|
|
|
$zipName=iconv('UTF-8','GB2312',$zipName);
|
...
|
...
|
@@ -823,7 +826,7 @@ class AdminCommonController extends AdminBaseController |
|
|
|
|
|
//判断当前操作系统
|
|
|
public function getOperateSys(){
|
|
|
$os_name = PHP_OS;
|
|
|
$os_name = php_uname('s');
|
|
|
//判断
|
|
|
if(strpos($os_name,"Linux")!==false){
|
|
|
$os_str="Linux";
|
...
|
...
|
|