|
|
|
@ -126,7 +126,7 @@ class BIZ_intel_train_model extends CI_Model {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ch_allstations(){
|
|
|
|
|
$sql = "SELECT * FROM TrainStation_intel where station_id != 10";
|
|
|
|
|
$sql = "SELECT * FROM [syn123] .tourmanager. dbo.TrainStation_intel where station_id != 10";
|
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|
|
return $query->result();
|
|
|
|
|
}
|
|
|
|
@ -146,31 +146,25 @@ class BIZ_intel_train_model extends CI_Model {
|
|
|
|
|
return $query->result();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ch_train_rules($station_id,$flag){
|
|
|
|
|
if($flag){
|
|
|
|
|
$and = "and s_country != 'Vietnam'";
|
|
|
|
|
}else{
|
|
|
|
|
$and = "";
|
|
|
|
|
}
|
|
|
|
|
public function ch_train_rules($station_id){
|
|
|
|
|
if($station_id == 11){
|
|
|
|
|
$station = "or tsi_FromStation = 10";
|
|
|
|
|
$station = "or tsi_FromStation = 10 or tsi_ToStation = 10";
|
|
|
|
|
}else{
|
|
|
|
|
$station = "";
|
|
|
|
|
}
|
|
|
|
|
$sql = "SELECT
|
|
|
|
|
S_ename,s_country,tsi_Message
|
|
|
|
|
FROM
|
|
|
|
|
TrainSearch_intel
|
|
|
|
|
[syn123] .tourmanager. dbo.TrainSearch_intel
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
TrainStation_intel
|
|
|
|
|
[syn123] .tourmanager. dbo.TrainStation_intel
|
|
|
|
|
ON
|
|
|
|
|
tsi_ToStation = station_id
|
|
|
|
|
where
|
|
|
|
|
tsi_FromStation = '{$station_id}'
|
|
|
|
|
(tsi_FromStation = ? or tsi_ToStation = ?)
|
|
|
|
|
";
|
|
|
|
|
$sql .= $and;
|
|
|
|
|
$sql .= $station;
|
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|
|
$query = $this->HT->query($sql,array($station_id,$station_id));
|
|
|
|
|
return $query->result();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|