diff --git a/application/language/english/form_validation_lang.php b/application/language/english/form_validation_lang.php
index 7a8af386..8dfc28cf 100644
--- a/application/language/english/form_validation_lang.php
+++ b/application/language/english/form_validation_lang.php
@@ -82,17 +82,17 @@ $lang['send_sms_success'] = '发送短消息成功!';
$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 http://a.cdnch.com/author.php';
-$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.cdnch.com (if the task is not in the Task Hall, someone else has already taken it).';
+$lang['author_email_new_task_body'] = 'You have a new task on the China Highlights Content Management System. Please log in at http://author.mycht.cn/author.php';
+$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 author.mycht.cn (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_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and requires revision. Please log in at http://a.cdnch.com/author.php';
+$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 http://author.mycht.cn/author.php';
$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 http://a.cdnch.com/author.php';
+$lang['author_email_review_task_success_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and accepted. See http://author.mycht.cn/author.php';
$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 http://a.cdnch.com/author.php';
+$lang['author_email_message_body'] = 'You have a new message on the China Highlights Content Management System. Please log in at http://author.mycht.cn/author.php';
//关键词管理
$lang['form_keyworlds_success'] = '关键词编辑成功!';
diff --git a/application/third_party/advertise/controllers/index.php b/application/third_party/advertise/controllers/index.php
index fba012ea..581fed60 100644
--- a/application/third_party/advertise/controllers/index.php
+++ b/application/third_party/advertise/controllers/index.php
@@ -6,7 +6,7 @@ if (!defined('BASEPATH'))
class Index extends CI_Controller
{
- public function __construct()
+ public function __construct()
{
parent::__construct();
$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['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['advertise']->ad_content = str_replace("url=//","url=https://",$data['advertise']->ad_content);
$this->load->view('bootstrap3/header', $data);
$this->load->view('advertise');
$this->load->view('bootstrap3/footer');
@@ -167,4 +168,4 @@ class Index extends CI_Controller
echo $result;
}
-}
\ No newline at end of file
+}
diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php
index 63dc51c1..1ba8e04d 100644
--- a/application/third_party/train/controllers/search.php
+++ b/application/third_party/train/controllers/search.php
@@ -6,7 +6,7 @@ class search extends CI_Controller{
public function __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://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);
-
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));
$return_data = new stdClass();
@@ -98,12 +105,16 @@ class search extends CI_Controller{
$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.'"';
//余票字符串
$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":{}}';
$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++;
}
}
diff --git a/application/third_party/train/models/BIZ_train_model.php b/application/third_party/train/models/BIZ_train_model.php
index 0bd387da..1f36dec3 100644
--- a/application/third_party/train/models/BIZ_train_model.php
+++ b/application/third_party/train/models/BIZ_train_model.php
@@ -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(
SELECT 1
- FROM TrainPriceList
- WHERE TPL_Train_Code = '$TPL_Train_Code'
- AND TPL_From_Station_Code = '$TPL_From_Station_Code'
- AND TPL_To_Station_Code = '$TPL_To_Station_Code'
+ FROM TrainPriceCache
+ WHERE
+ tpc_from_station = '$tpc_from_station'
+ AND tpc_to_station = '$tpc_to_station'
) BEGIN
- INSERT INTO TrainPriceList
+ INSERT INTO TrainPriceCache
(
- TPL_Train_No,
- TPL_Train_Code,
- TPL_From_Station_Code,
- TPL_To_Station_Code,
- TPL_Price,
- TPL_Datetime,
- TPL_Source
+ tpc_from_station,
+ tpc_to_station,
+ tpc_content,
+ tpc_datetime,
+ tpc_source
)
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
ELSE
BEGIN
- UPDATE TrainPriceList
- SET TPL_Train_No = '$TPL_Train_No',
- TPL_Price = '$TPL_Price',
- TPL_Datetime = GETDATE(),
- TPL_Source = 'juhe'
- WHERE TPL_Train_Code = '$TPL_Train_Code'
- AND TPL_From_Station_Code = '$TPL_From_Station_Code'
- AND TPL_To_Station_Code = '$TPL_To_Station_Code'
+ UPDATE TrainPriceCache
+ SET tpc_from_station = '$tpc_from_station',
+ tpc_to_station = '$tpc_to_station',
+ tpc_datetime = GETDATE(),
+ tpc_source = 'juhe'
+ WHERE
+ tpc_from_station = '$tpc_from_station'
+ AND tpc_to_station = '$tpc_to_station'
END
";
$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
- TPL_Price
+ *
FROM
- TrainPriceList
+ TrainPriceCache
WHERE
- TPL_Train_Code = '$trainCode'
- AND
- TPL_From_Station_Code = '$fromStationCode'
+ tpc_from_station = '$tpc_from_station'
AND
- TPL_To_Station_Code = '$toStationCode'";
+ tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql);
return $query->row();
}