Merge branch 'master' of git.mycht.cn:developers/information-system

pull
hotfix/远程访问多媒体中心
lmr@hainatravel.com 8 years ago
commit ddee36b942

@ -82,17 +82,17 @@ $lang['send_sms_success'] = '发送短消息成功!';
$lang['author_email_new_task_subject'] = 'New Task,%s'; $lang['author_email_new_task_subject'] = 'New Task,%s';
$lang['author_email_new_task_body'] = 'You have a new task on the China Highlights Content Management System. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>'; $lang['author_email_new_task_body'] = 'You have a new task on the China Highlights Content Management System. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_new_task_body2'] = 'There is a new task on the China Highlights Content Management System. Click “Accept” before someone else does if you want it! Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">a.cdnch.com</a> (if the task is not in the Task Hall, someone else has already taken it).'; $lang['author_email_new_task_body2'] = 'There is a new task on the China Highlights Content Management System. Click “Accept” before someone else does if you want it! Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">author.mycht.cn</a> (if the task is not in the Task Hall, someone else has already taken it).';
$lang['author_email_review_task_failed_subject'] = 'Revision Required,%s'; $lang['author_email_review_task_failed_subject'] = 'Revision Required,%s';
$lang['author_email_review_task_failed_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and requires revision. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>'; $lang['author_email_review_task_failed_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and requires revision. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_review_task_success_subject'] = 'Submission Accepted,%s'; $lang['author_email_review_task_success_subject'] = 'Submission Accepted,%s';
$lang['author_email_review_task_success_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and accepted. See <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>'; $lang['author_email_review_task_success_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and accepted. See <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_message_subject'] = 'Message,%s'; $lang['author_email_message_subject'] = 'Message,%s';
$lang['author_email_message_body'] = 'You have a new message on the China Highlights Content Management System. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>'; $lang['author_email_message_body'] = 'You have a new message on the China Highlights Content Management System. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
//关键词管理 //关键词管理
$lang['form_keyworlds_success'] = '关键词编辑成功!'; $lang['form_keyworlds_success'] = '关键词编辑成功!';

@ -6,7 +6,7 @@ if (!defined('BASEPATH'))
class Index extends CI_Controller class Index extends CI_Controller
{ {
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->permission->is_admin(); $this->permission->is_admin();
@ -55,6 +55,7 @@ class Index extends CI_Controller
$data['advertise']=$this->advertise_model->get_advertise_treeid($data['ad_is_id']); $data['advertise']=$this->advertise_model->get_advertise_treeid($data['ad_is_id']);
$data['webpage_list']=$this->advertise_model->get_advertise_page($data['ad_is_id']); $data['webpage_list']=$this->advertise_model->get_advertise_page($data['ad_is_id']);
$data['click_rate']=$this->advertise_model->get_click_rate($data['advertise']->ad_id); $data['click_rate']=$this->advertise_model->get_click_rate($data['advertise']->ad_id);
$data['advertise']->ad_content = str_replace("url=//","url=https://",$data['advertise']->ad_content);
$this->load->view('bootstrap3/header', $data); $this->load->view('bootstrap3/header', $data);
$this->load->view('advertise'); $this->load->view('advertise');
$this->load->view('bootstrap3/footer'); $this->load->view('bootstrap3/footer');
@ -167,4 +168,4 @@ class Index extends CI_Controller
echo $result; echo $result;
} }
} }

@ -6,7 +6,7 @@ class search extends CI_Controller{
public function __construct(){ public function __construct(){
parent::__construct(); parent::__construct();
//$this->load->model("BIZ_train_model");//加载模型 $this->load->model("BIZ_train_model");//加载模型
} }
//查询聚合余票接口,对返回的数据进行处理 //查询聚合余票接口,对返回的数据进行处理
@ -18,9 +18,16 @@ class search extends CI_Controller{
//$url = 'http://op.juhe.cn/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation; //$url = 'http://op.juhe.cn/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$url = 'http://139.129.246.118:12309/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation; $url = 'http://139.129.246.118:12309/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$back_data = $this->get_http($url); $back_data = $this->get_http($url);
if(empty(json_decode($back_data)->result)){ if(empty(json_decode($back_data)->result)){
log_message('error','juhetrain:'.$url); log_message('error','juhetrain:'.$url.' '.$back_data);
$obj = $this->BIZ_train_model->get_train_info($fromStation,$toStation);
if($obj){
$back_data = $obj->tpc_content;
log_message('error','Sn:'.$obj->tpc_sn.'|time:'.$obj->tpc_datetime);
}
}else{
$this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$back_data);
} }
//print_r(json_decode($back_data)); //print_r(json_decode($back_data));
$return_data = new stdClass(); $return_data = new stdClass();
@ -98,12 +105,16 @@ class search extends CI_Controller{
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",'; $seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",';
} }
} }
if(isset($value->dw_price)){
if($value->dw_price > 0){
$seat_type .= '"F":"¥'.$value->dw_price.'",';
}
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"'; $pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"';
//余票字符串 //余票字符串
$return_data->data->result[$i] = '|预定|'.$value->train_no.'|'.$value->train_code.'|'.$value->from_station_name.'|'.$value->to_station_name.'|'.$value->from_station_code.'|'.$value->to_station_code.'|'.$value->start_time.'|'.$value->arrive_time.'|'.$value->run_time.'|'.$value->can_buy_now.'||'.$value->train_start_date.'||||||||'.$this->ticket_exchange($value->gjrw_num).'|'.$this->ticket_exchange($value->qtxb_num).'|'.$this->ticket_exchange($value->rw_num).'|'.$this->ticket_exchange($value->rz_num).'|'.$this->ticket_exchange($value->tdz_num).'|'.$this->ticket_exchange($value->wz_num).'||'.$this->ticket_exchange($value->yw_num).'|'.$this->ticket_exchange($value->yz_num).'|'.$this->ticket_exchange($value->edz_num).'|'.$this->ticket_exchange($value->ydz_num).'|'.$this->ticket_exchange($value->swz_num).'|'.$this->ticket_exchange($value->dw_num).'||'; $return_data->data->result[$i] = '|预定|'.$value->train_no.'|'.$value->train_code.'|'.$value->from_station_name.'|'.$value->to_station_name.'|'.$value->from_station_code.'|'.$value->to_station_code.'|'.$value->start_time.'|'.$value->arrive_time.'|'.$value->run_time.'|'.$value->can_buy_now.'||'.$value->train_start_date.'||||||||'.$this->ticket_exchange($value->gjrw_num).'|'.$this->ticket_exchange($value->qtxb_num).'|'.$this->ticket_exchange($value->rw_num).'|'.$this->ticket_exchange($value->rz_num).'|'.$this->ticket_exchange($value->tdz_num).'|'.$this->ticket_exchange($value->wz_num).'||'.$this->ticket_exchange($value->yw_num).'|'.$this->ticket_exchange($value->yz_num).'|'.$this->ticket_exchange($value->edz_num).'|'.$this->ticket_exchange($value->ydz_num).'|'.$this->ticket_exchange($value->swz_num).'|'.$this->ticket_exchange($value->dw_num).'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}'; $data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data; $return_data->data->price[$i] = $data;
//$this->BIZ_train_model->addOrUpdate($value->train_no,$value->train_code,$value->from_station_code,$value->to_station_code,json_encode($data));
$i++; $i++;
} }
} }

@ -9,39 +9,37 @@ class BIZ_train_model extends CI_Model {
} }
//新增或更新价格 //新增或更新价格
public function addOrUpdate($TPL_Train_No,$TPL_Train_Code,$TPL_From_Station_Code,$TPL_To_Station_Code,$TPL_Price){ public function addOrUpdate($tpc_from_station,$tpc_to_station,$tpc_content){
$sql = "IF NOT EXISTS( $sql = "IF NOT EXISTS(
SELECT 1 SELECT 1
FROM TrainPriceList FROM TrainPriceCache
WHERE TPL_Train_Code = '$TPL_Train_Code' WHERE
AND TPL_From_Station_Code = '$TPL_From_Station_Code' tpc_from_station = '$tpc_from_station'
AND TPL_To_Station_Code = '$TPL_To_Station_Code' AND tpc_to_station = '$tpc_to_station'
) BEGIN ) BEGIN
INSERT INTO TrainPriceList INSERT INTO TrainPriceCache
( (
TPL_Train_No, tpc_from_station,
TPL_Train_Code, tpc_to_station,
TPL_From_Station_Code, tpc_content,
TPL_To_Station_Code, tpc_datetime,
TPL_Price, tpc_source
TPL_Datetime,
TPL_Source
) )
VALUES VALUES
( (
'$TPL_Train_No','$TPL_Train_Code','$TPL_From_Station_Code','$TPL_To_Station_Code','$TPL_Price',GETDATE(),'juhe' '$tpc_from_station','$tpc_to_station','$tpc_content',GETDATE(),'juhe'
) )
END END
ELSE ELSE
BEGIN BEGIN
UPDATE TrainPriceList UPDATE TrainPriceCache
SET TPL_Train_No = '$TPL_Train_No', SET tpc_from_station = '$tpc_from_station',
TPL_Price = '$TPL_Price', tpc_to_station = '$tpc_to_station',
TPL_Datetime = GETDATE(), tpc_datetime = GETDATE(),
TPL_Source = 'juhe' tpc_source = 'juhe'
WHERE TPL_Train_Code = '$TPL_Train_Code' WHERE
AND TPL_From_Station_Code = '$TPL_From_Station_Code' tpc_from_station = '$tpc_from_station'
AND TPL_To_Station_Code = '$TPL_To_Station_Code' AND tpc_to_station = '$tpc_to_station'
END END
"; ";
$query = $this->INFO->query($sql); $query = $this->INFO->query($sql);
@ -49,17 +47,15 @@ class BIZ_train_model extends CI_Model {
} }
//获取价格 //获取价格
public function get_price($fromStationCode,$toStationCode,$trainCode){ public function get_train_info($tpc_from_station,$tpc_to_station){
$sql = "SELECT $sql = "SELECT
TPL_Price *
FROM FROM
TrainPriceList TrainPriceCache
WHERE WHERE
TPL_Train_Code = '$trainCode' tpc_from_station = '$tpc_from_station'
AND
TPL_From_Station_Code = '$fromStationCode'
AND AND
TPL_To_Station_Code = '$toStationCode'"; tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql); $query = $this->INFO->query($sql);
return $query->row(); return $query->row();
} }

Loading…
Cancel
Save