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

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

Loading…
Cancel
Save