mobile-first
赵鹏 6 years ago
parent 321d7fce51
commit a3147b0102

@ -10,7 +10,7 @@
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
ini_set('memory_limit','256M'); ini_set('memory_limit', '256M');
class updatestation extends CI_Controller class updatestation extends CI_Controller
{ {
@ -30,13 +30,14 @@ class updatestation extends CI_Controller
$this->load->view('bootstrap3/footer'); $this->load->view('bootstrap3/footer');
} }
public function test(){ public function test()
$results=""; {
for($i=1; $i<=2000000; $i++){ $results = "";
$results.='"'.$i.'"'; for ($i = 1; $i <= 2000000; $i++) {
$results .= '"' . $i . '"';
} }
$len = strlen($results); $len = strlen($results);
header("Content-Length: ".$len); header("Content-Length: " . $len);
header("Content-Encoding:UTF-8"); header("Content-Encoding:UTF-8");
echo $results; echo $results;
} }
@ -54,7 +55,7 @@ class updatestation extends CI_Controller
$arr_Station = explode("@", str_replace("';", "", str_replace("var station_names ='", "", $StationData))); $arr_Station = explode("@", str_replace("';", "", str_replace("var station_names ='", "", $StationData)));
//print_r($arr_Station); //print_r($arr_Station);
$NewStation = ""; $NewStation = "";
$UpdateStaion=""; $UpdateStaion = "";
for ($i = 0; $i < count($arr_Station); $i++) { for ($i = 0; $i < count($arr_Station); $i++) {
if ($arr_Station[$i] != null) { if ($arr_Station[$i] != null) {
$arr_StationDetail = explode("|", $arr_Station[$i]); $arr_StationDetail = explode("|", $arr_Station[$i]);
@ -69,7 +70,7 @@ class updatestation extends CI_Controller
$strStation = "@-1|" . $TRS_Code . "|" . $TRS_Station . "|" . $TRS_StationCN . "|2|"; $strStation = "@-1|" . $TRS_Code . "|" . $TRS_Station . "|" . $TRS_StationCN . "|2|";
$UpdateStaion .= $strStation; $UpdateStaion .= $strStation;
//表操作 //表操作
// $this->station_model->UpdateStation($TRS_Code, $TRS_StationCN); // $this->station_model->UpdateStation($TRS_Code, $TRS_StationCN);
} else if ($isNew == 2) { } else if ($isNew == 2) {
//新增 //新增
$strStation = "@9999|" . $TRS_Code . "|" . $TRS_Station . "|" . $TRS_StationCN . "|2|"; $strStation = "@9999|" . $TRS_Code . "|" . $TRS_Station . "|" . $TRS_StationCN . "|2|";
@ -82,21 +83,24 @@ class updatestation extends CI_Controller
} }
} }
} }
$NewStationList = $UpdateStaion.$NewStation; $NewStationList = $UpdateStaion . $NewStation;
//发送邮件
$this->station_model->SendMail(
"UpdateStationSystem",
"noreplay@email.com",
'zhaopeng',
'zhaopeng@hainatravel.com',
'New Station(by12306):' . date("Y-m-d"),
$NewStationList
);
$len = strlen($NewStationList);//count( explode("@",$NewStationList))-1; $len = strlen($NewStationList); //count( explode("@",$NewStationList))-1;
header("Content-Length: ".$len); header("Content-Length: " . $len);
header("Content-Encoding:UTF-8"); header("Content-Encoding:UTF-8");
echo $NewStationList; echo $NewStationList;
if ($len > 0) {
//发送邮件
$this->station_model->SendMail(
"UpdateStationSystem",
"noreplay@email.com",
'zhaopeng',
'zhaopeng@hainatravel.com',
'New Station(by12306):' . date("Y-m-d"),
$NewStationList
);
}
} }
/** /**
@ -123,10 +127,9 @@ class updatestation extends CI_Controller
$arr_StationFileDetail = explode("|", $arr_StationFile[$j]); $arr_StationFileDetail = explode("|", $arr_StationFile[$j]);
//对比目前的站点文件,如果是新的就保存 //对比目前的站点文件,如果是新的就保存
if ($arr_StationDetail[2] == $arr_StationFileDetail[1] && $arr_StationDetail[1] == $arr_StationFileDetail[3]) { if ($arr_StationDetail[2] == $arr_StationFileDetail[1] && $arr_StationDetail[1] == $arr_StationFileDetail[3]) {
$isNew = false; $isNew = false;
break; break;
} }
} }
} }

Loading…
Cancel
Save