From 851bfaa13a6f1cf89d5a9f4592db22187c94d587 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 27 Nov 2017 14:27:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=81=9A=E5=90=88=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B0=86=E5=8A=A8=E5=8D=A7=E4=B8=8E=E8=BD=AF?= =?UTF-8?q?=E5=8D=A7=E6=95=B0=E6=8D=AE=E5=88=86=E7=A6=BB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 63dc51c1..5cbf336f 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -98,6 +98,11 @@ 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).'||'; From e9c8c942d700136b7231ec88238e1a08315897ed Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 28 Nov 2017 09:58:30 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=B0=86=E5=80=BC=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E7=9A=84=E8=81=9A=E5=90=88=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=BF=A1=E6=81=AF=E4=B9=9F=E5=85=A8=E9=83=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=88=B0=E6=97=A5=E5=BF=97=E5=BD=93=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 5cbf336f..2248c237 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -18,9 +18,8 @@ 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); } //print_r(json_decode($back_data)); $return_data = new stdClass(); From 1e0fc4ad9f558c56ec70b7f266b6cf45a60120cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Tue, 28 Nov 2017 14:11:21 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/language/english/form_validation_lang.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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'] = '关键词编辑成功!'; From 456aa722b8af194b215a1b8a8e551a6f839eb65e Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 28 Nov 2017 16:04:15 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2url=E5=8F=82=E6=95=B0=E4=B8=AD=E7=9A=84//?= =?UTF-8?q?=E4=B8=BAhttps://=20editor=E5=88=87=E6=8D=A2=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=97=B6=E8=87=AA=E5=8A=A8=E5=B0=86//?= =?UTF-8?q?=E6=94=B9=E4=B8=BA/,=E8=AE=A4=E4=B8=BA=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84//=E4=B8=8D=E5=90=88=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/advertise/controllers/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +} From 295dab2bbeb5141a79b3966cab4181318b1351a7 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 30 Nov 2017 13:51:22 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=B0=86=E6=9F=A5=E8=AF=A2=E5=88=B0?= =?UTF-8?q?=E7=9A=84=E5=8E=9F=E5=A7=8B=E4=BF=A1=E6=81=AF=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/train/controllers/search.php | 6 ++- .../train/models/BIZ_train_model.php | 40 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 2248c237..7f332410 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");//加载模型 } //查询聚合余票接口,对返回的数据进行处理 @@ -20,6 +20,8 @@ class search extends CI_Controller{ $back_data = $this->get_http($url); if(empty(json_decode($back_data)->result)){ log_message('error','juhetrain:'.$url.' '.$back_data); + }else{ + $this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$back_data); } //print_r(json_decode($back_data)); $return_data = new stdClass(); @@ -31,6 +33,7 @@ class search extends CI_Controller{ $i = 0; $pricestr = ''; if(!empty(json_decode($back_data)->result->list)){ + foreach (json_decode($back_data)->result->list as $value){ $obj[$value->from_station_code] = $value->from_station_name; $obj[$value->to_station_code] = $value->to_station_name; @@ -107,7 +110,6 @@ class search extends CI_Controller{ $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..13b3ecb3 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(), + UPDATE TrainPriceCache + SET tpc_from_station = '$tpc_from_station', + tpc_to_station = '$tpc_to_station', + tpc_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' + WHERE + tpc_from_station = '$tpc_from_station' + AND tpc_to_station = '$tpc_to_station' END "; $query = $this->INFO->query($sql); From a26af774ac05fdbedf1b084e74090c7a4dd55153 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 30 Nov 2017 13:55:12 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=90=8C=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/models/BIZ_train_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/third_party/train/models/BIZ_train_model.php b/application/third_party/train/models/BIZ_train_model.php index 13b3ecb3..897c1bf9 100644 --- a/application/third_party/train/models/BIZ_train_model.php +++ b/application/third_party/train/models/BIZ_train_model.php @@ -36,7 +36,7 @@ class BIZ_train_model extends CI_Model { SET tpc_from_station = '$tpc_from_station', tpc_to_station = '$tpc_to_station', tpc_datetime = GETDATE(), - TPL_Source = 'juhe' + tpc_source = 'juhe' WHERE tpc_from_station = '$tpc_from_station' AND tpc_to_station = '$tpc_to_station' From 9a1db006776018508b2626880ad964706bc6f122 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 30 Nov 2017 14:41:53 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A0=E6=B3=95=E8=AF=BB=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E6=9F=A5=E8=AF=A2=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 4 +++- .../third_party/train/models/BIZ_train_model.php | 12 +++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 7f332410..9e3303e6 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -20,6 +20,9 @@ class search extends CI_Controller{ $back_data = $this->get_http($url); if(empty(json_decode($back_data)->result)){ log_message('error','juhetrain:'.$url.' '.$back_data); + $obj = $this->BIZ_train_model->get_train_info($fromStation,$toStation); + $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); } @@ -33,7 +36,6 @@ class search extends CI_Controller{ $i = 0; $pricestr = ''; if(!empty(json_decode($back_data)->result->list)){ - foreach (json_decode($back_data)->result->list as $value){ $obj[$value->from_station_code] = $value->from_station_name; $obj[$value->to_station_code] = $value->to_station_name; diff --git a/application/third_party/train/models/BIZ_train_model.php b/application/third_party/train/models/BIZ_train_model.php index 897c1bf9..1f36dec3 100644 --- a/application/third_party/train/models/BIZ_train_model.php +++ b/application/third_party/train/models/BIZ_train_model.php @@ -47,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(); } From 8d783c4411f442a51fb90ed1b0b108e5a6504deb Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 30 Nov 2017 14:55:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=90=8C=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 9e3303e6..1ba8e04d 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -21,8 +21,11 @@ class search extends CI_Controller{ if(empty(json_decode($back_data)->result)){ log_message('error','juhetrain:'.$url.' '.$back_data); $obj = $this->BIZ_train_model->get_train_info($fromStation,$toStation); - $back_data = $obj->tpc_content; - log_message('error','Sn:'.$obj->tpc_sn.'|time:'.$obj->tpc_datetime); + 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); }