From 2d18bbf97101b5311ad391c658d00a5bef02dd2d Mon Sep 17 00:00:00 2001 From: "lmr@hainatravel.com" <59361885@qq.com> Date: Mon, 23 Oct 2017 16:35:21 +0800 Subject: [PATCH 01/55] =?UTF-8?q?=E6=A8=A1=E6=9D=BFfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lmrxedit/template/0.php | 6 +++--- lmrxedit/template/1.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lmrxedit/template/0.php b/lmrxedit/template/0.php index 6bd5ead0..04342d85 100644 --- a/lmrxedit/template/0.php +++ b/lmrxedit/template/0.php @@ -7,14 +7,14 @@ - - + + - + diff --git a/lmrxedit/template/1.php b/lmrxedit/template/1.php index 6b3a3227..bd293f5f 100644 --- a/lmrxedit/template/1.php +++ b/lmrxedit/template/1.php @@ -7,14 +7,14 @@ - - + + - + From f6e2383ec17b57334f2d1664ad10aa0d7e775b11 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 13:51:51 +0800 Subject: [PATCH 02/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=80=92=E5=BA=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 19 +++++++++++-------- application/views/keyworlds/index.php | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 1c6706db..4a0e7cbf 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -95,8 +95,6 @@ class Keyworlds extends CI_Controller { } } } -// print_r($data['wordcount']); -// print_r($rank_json); // 拼接highcharts数据格式 $data['rank_json'] = '['; foreach ($rank_json as &$ra) { @@ -134,10 +132,10 @@ class Keyworlds extends CI_Controller { } } $data['rank_json'] = substr($data['rank_json'], 0, -1) . ']'; -// print_r($data['rank_json']); $data['data_time'] = json_encode($data_time); $data['rank_info'] = ''; isset($rank_json[$data['current_keyworld']->kw_id]) && $data['rank_info'] = $rank_json[$data['current_keyworld']->kw_id]; + arsort($data['rank_info']); } } else { redirect(site_url("Keyworlds/index")); @@ -297,7 +295,7 @@ class Keyworlds extends CI_Controller { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); // 仅更新一个字段 - if (intval($rank['rank']) == 0) { + if (intval($rank['rank']) === 0) { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { @@ -327,7 +325,11 @@ class Keyworlds extends CI_Controller { $this->Keywords_model->update_time($kw_id); } } - $data[] = array('name' => 'rank', 'value' => ($rank['rank'] . " -- " . $rank["rank_m"])); + $data[] = array( + 'name' => 'rank', + 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), + 'real' => $rank_flag . " : " . $rank[$rank_flag] + ); echo json_encode($data); return TRUE; } @@ -368,7 +370,8 @@ class Keyworlds extends CI_Controller { } else if ($engines == 'yandex') {//俄语站的yangdex $rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); } - if (intval($rank['rank']) == 0) { + + if (intval($rank['rank']) === 0) { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { @@ -648,8 +651,8 @@ class Keyworlds extends CI_Controller { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); - // curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); - // curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 + curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); + curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 if ($referer) { curl_setopt($ch, CURLOPT_REFERER, $referer); } diff --git a/application/views/keyworlds/index.php b/application/views/keyworlds/index.php index 0fb8187d..979c8b6b 100644 --- a/application/views/keyworlds/index.php +++ b/application/views/keyworlds/index.php @@ -62,8 +62,8 @@
kwr_mobile_source; ?> - kwr_rank; ?> --  - kwr_mobile_rank ? $rank->kwr_mobile_rank : '未抓取'; echo $kwr_mobile_rank; ?> + kwr_rank; ?>  /   + kwr_mobile_rank ? $rank->kwr_mobile_rank : '--'; echo $kwr_mobile_rank; ?> From 889f7328bdd1fbedc7cc57ecee05fa64f0db0dd8 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 13:56:08 +0800 Subject: [PATCH 03/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BE=85=E6=9B=B4=E6=96=B0=E7=9A=84=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/infokeywords_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/infokeywords_model.php b/application/models/infokeywords_model.php index a18dc82d..1714808a 100644 --- a/application/models/infokeywords_model.php +++ b/application/models/infokeywords_model.php @@ -94,7 +94,7 @@ class infoKeywords_model extends CI_Model FROM infoKeywords INNER JOIN infoKeywordsrank ON kwr_kw_id=kw_id AND kwr_id = ( SELECT MAX(kwr_id) FROM infoKeywordsrank WHERE kwr_kw_id=kw_id ) AND (kwr_datetime<'$today' - OR kwr_mobile_rank IS NULL) + OR kwr_mobile_rank IS NULL OR kwr_mobile_rank=0) WHERE kw_status=1 $map ORDER BY newid()"; $query = $this->HT->query($sql); From 7a0a23b919614298aacb81f610a63335c357c7cc Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 14:06:32 +0800 Subject: [PATCH 04/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 4a0e7cbf..097afd2f 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -284,7 +284,7 @@ class Keyworlds extends CI_Controller { echo json_encode($data); return TRUE; } else if (empty($last_rank[0]->kwr_mobile_rank) && - intval($last_rank[0]->kwr_datetime) > intval($today)) { + (intval($last_rank[0]->kwr_datetime) - intval($today)) >= 0 ) { $client_flag = 'm'; $rank_flag = 'rank_m'; $source_flag = 'source_m'; @@ -351,7 +351,7 @@ class Keyworlds extends CI_Controller { $client_flag = "PC"; $rank_flag = 'rank'; $source_flag = 'source'; - if (intval($worldsList[0]->kwr_datetime) >= intval($today) ) { + if ((intval($worldsList[0]->kwr_datetime) - intval($today)) >= 0 ) { $client_flag = "m"; $rank_flag = 'rank_m'; $source_flag = 'source_m'; @@ -651,8 +651,8 @@ class Keyworlds extends CI_Controller { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); - curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); - curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 + // curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); + // curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 if ($referer) { curl_setopt($ch, CURLOPT_REFERER, $referer); } From 7a64f3235f0ca95d043eb88fb92f3d6d17872b50 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 14:11:49 +0800 Subject: [PATCH 05/55] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 097afd2f..6048ebfd 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -328,7 +328,8 @@ class Keyworlds extends CI_Controller { $data[] = array( 'name' => 'rank', 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), - 'real' => $rank_flag . " : " . $rank[$rank_flag] + 'real' => $rank_flag . " : " . $rank[$rank_flag], + 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) ); echo json_encode($data); return TRUE; From 14c24eac0e818ec5f9d92fed4ccad8ca4b65e2a1 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 14:23:58 +0800 Subject: [PATCH 06/55] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 6048ebfd..5b412000 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -280,11 +280,12 @@ class Keyworlds extends CI_Controller { $source_flag = 'source'; $last_rank = $this->Keywordsrank_model->get_rank_list($kw_id, $top = 1); if (isset($last_rank[0]->kwr_datetime) and ( time() - $last_rank[0]->kwr_datetime) < 180) { - $data[] = array('name' => 'rank', 'value' => '查询过于频繁,请等待三分钟!'); - echo json_encode($data); - return TRUE; - } else if (empty($last_rank[0]->kwr_mobile_rank) && - (intval($last_rank[0]->kwr_datetime) - intval($today)) >= 0 ) { + // $data[] = array('name' => 'rank', 'value' => '查询过于频繁,请等待三分钟!'); + // echo json_encode($data); + // return TRUE; + } + if ((intval($last_rank[0]->kwr_mobile_rank) == 0 || !isset($last_rank[0]->kwr_mobile_rank)) && + (intval($last_rank[0]->kwr_datetime) >= intval($today)) ) { $client_flag = 'm'; $rank_flag = 'rank_m'; $source_flag = 'source_m'; @@ -329,7 +330,7 @@ class Keyworlds extends CI_Controller { 'name' => 'rank', 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), 'real' => $rank_flag . " : " . $rank[$rank_flag], - 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) + 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag ); echo json_encode($data); return TRUE; @@ -352,7 +353,7 @@ class Keyworlds extends CI_Controller { $client_flag = "PC"; $rank_flag = 'rank'; $source_flag = 'source'; - if ((intval($worldsList[0]->kwr_datetime) - intval($today)) >= 0 ) { + if ((intval($worldsList[0]->kwr_datetime) >= intval($today)) ) { $client_flag = "m"; $rank_flag = 'rank_m'; $source_flag = 'source_m'; From f32c94cda3c6159795ea1cb987907f4859e7065c Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 14:36:47 +0800 Subject: [PATCH 07/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 5b412000..11fdd5f6 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -295,8 +295,9 @@ class Keyworlds extends CI_Controller { for ($i = 1; $i <= 15; $i++) { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); + echo ""; // 仅更新一个字段 - if (intval($rank['rank']) === 0) { + if (intval($rank['rank']) === 0 && $client_flag == 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { @@ -373,7 +374,7 @@ class Keyworlds extends CI_Controller { $rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); } - if (intval($rank['rank']) === 0) { + if (intval($rank['rank']) === 0 && $client_flag == 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { From edb796acf1417801caa061d0b286bc6b09013d6c Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 14:39:43 +0800 Subject: [PATCH 08/55] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 11fdd5f6..ad95be79 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -280,9 +280,9 @@ class Keyworlds extends CI_Controller { $source_flag = 'source'; $last_rank = $this->Keywordsrank_model->get_rank_list($kw_id, $top = 1); if (isset($last_rank[0]->kwr_datetime) and ( time() - $last_rank[0]->kwr_datetime) < 180) { - // $data[] = array('name' => 'rank', 'value' => '查询过于频繁,请等待三分钟!'); - // echo json_encode($data); - // return TRUE; + $data[] = array('name' => 'rank', 'value' => '查询过于频繁,请等待三分钟!'); + echo json_encode($data); + return TRUE; } if ((intval($last_rank[0]->kwr_mobile_rank) == 0 || !isset($last_rank[0]->kwr_mobile_rank)) && (intval($last_rank[0]->kwr_datetime) >= intval($today)) ) { @@ -295,7 +295,6 @@ class Keyworlds extends CI_Controller { for ($i = 1; $i <= 15; $i++) { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); - echo ""; // 仅更新一个字段 if (intval($rank['rank']) === 0 && $client_flag == 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; From 278ecbb09c40d1b283551d2161f2e5e3fb7c658c Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 30 Oct 2017 15:00:53 +0800 Subject: [PATCH 09/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=97=B6PC=E7=9A=84?= =?UTF-8?q?=E6=8E=92=E5=90=8D=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index ad95be79..0e0a82b9 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -296,7 +296,7 @@ class Keyworlds extends CI_Controller { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); // 仅更新一个字段 - if (intval($rank['rank']) === 0 && $client_flag == 'm') { + if ($client_flag == 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { @@ -373,7 +373,7 @@ class Keyworlds extends CI_Controller { $rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); } - if (intval($rank['rank']) === 0 && $client_flag == 'm') { + if ($client_flag == 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { From 4451eca488d3b6ba78390d1df074e74527713816 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 31 Oct 2017 10:19:07 +0800 Subject: [PATCH 10/55] no message --- application/third_party/train/controllers/search.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 18109911..610799df 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -16,6 +16,10 @@ class search extends CI_Controller{ }else{ $url = 'http://op.juhe.cn/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); + } //print_r(json_decode($back_data)); $return_data = new stdClass(); $return_data->httpstatus = 200; From d7e2387c38c2550dfbb3928cf7208ae33bd53c40 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 31 Oct 2017 10:50:00 +0800 Subject: [PATCH 11/55] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 610799df..59c7b75f 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -11,6 +11,7 @@ class search extends CI_Controller{ //查询聚合余票接口,对返回的数据进行处理 public function index($train_date=null,$fromStation=null,$toStation=null){ + set_time_limit(0); if(!$train_date || !$fromStation || !$toStation){ exit('传参错误!'); }else{ From 510885c6ae5c2d77865a373c097b2ed7b24561b7 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 31 Oct 2017 11:30:05 +0800 Subject: [PATCH 12/55] =?UTF-8?q?=E9=80=94=E7=89=9B=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8D=E9=99=90PHP=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/tuniu/controllers/tuniu_train.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/third_party/tuniu/controllers/tuniu_train.php b/application/third_party/tuniu/controllers/tuniu_train.php index 1eb329e6..a70d08ea 100644 --- a/application/third_party/tuniu/controllers/tuniu_train.php +++ b/application/third_party/tuniu/controllers/tuniu_train.php @@ -36,6 +36,7 @@ class Tuniu_train extends CI_Controller{ //获取余票 public function search($date=null,$fromStation=null,$toStation=null){ + set_time_limit(0); if(!$date || !$fromStation || !$toStation){ exit('传参错误!'); }else{ @@ -49,7 +50,10 @@ class Tuniu_train extends CI_Controller{ "data": { "trainDate": "'.$date.'", "fromStation": "'.$fromStation.'", "toStation": "'.$toStation.'", "trainCode": "" } }'; $back_data = post_tuniu($url,$post_data,$method = 'POST'); - //print_r(json_decode($back_data)); + if(empty(json_decode($back_data)->data)){ + log_message('error','tuniu:'.json_encode($post_data)); + } + print_r(json_decode($back_data)->data); $return_data = new stdClass(); $return_data->returnCode = json_decode($back_data)->returnCode; //echo $return_data->returnCode; From 2fb452eb7ee6ebe387287c135354d7d6dd0860e2 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 31 Oct 2017 11:49:34 +0800 Subject: [PATCH 13/55] no message --- application/third_party/tuniu/controllers/tuniu_train.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/third_party/tuniu/controllers/tuniu_train.php b/application/third_party/tuniu/controllers/tuniu_train.php index a70d08ea..08bcb176 100644 --- a/application/third_party/tuniu/controllers/tuniu_train.php +++ b/application/third_party/tuniu/controllers/tuniu_train.php @@ -53,7 +53,7 @@ class Tuniu_train extends CI_Controller{ if(empty(json_decode($back_data)->data)){ log_message('error','tuniu:'.json_encode($post_data)); } - print_r(json_decode($back_data)->data); + //print_r(json_decode($back_data)->data); $return_data = new stdClass(); $return_data->returnCode = json_decode($back_data)->returnCode; //echo $return_data->returnCode; From e2a40a99d438d61b97b0a76bef43baff61a69866 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 31 Oct 2017 11:56:20 +0800 Subject: [PATCH 14/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E5=85=88?= =?UTF-8?q?=E5=8F=96=E6=97=B6=E9=97=B4=E6=9C=80=E9=95=BF=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 3 ++- application/models/infokeywords_model.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 0e0a82b9..f4f4a35e 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -452,7 +452,8 @@ class Keyworlds extends CI_Controller { $response = $this->curl($url,$client_flag); if ($response) { //分析google搜索结果,计算排名 - if (false !== stripos($response, '

302 Moved

')) { + if (false !== stripos($response, '

302 Moved

') || + false !== stripos($response, 'captcha')) { $rank['rank'] = -2; } elseif (false !== stripos($response, $site_url)) { preg_match_all($match_fun, $response, $store); diff --git a/application/models/infokeywords_model.php b/application/models/infokeywords_model.php index 1714808a..9c23fbd1 100644 --- a/application/models/infokeywords_model.php +++ b/application/models/infokeywords_model.php @@ -96,7 +96,7 @@ class infoKeywords_model extends CI_Model AND (kwr_datetime<'$today' OR kwr_mobile_rank IS NULL OR kwr_mobile_rank=0) WHERE kw_status=1 $map - ORDER BY newid()"; + ORDER BY kwr_datetime ASC"; $query = $this->HT->query($sql); //print_r($this->HT->queries); $result = $query->result(); From c261b8634283f03b004148425cffd8ae080628fa Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 31 Oct 2017 14:59:27 +0800 Subject: [PATCH 15/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA=E6=94=B9=E4=B8=BA=E6=8C=89=E6=97=B6=E9=97=B4=E6=AD=A3?= =?UTF-8?q?=E5=BA=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 77 ++++++++++------------- application/models/infokeywords_model.php | 38 +++++++++-- application/views/keyworlds/index.php | 16 ----- 3 files changed, 67 insertions(+), 64 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index f4f4a35e..aaa0aca5 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -104,13 +104,10 @@ class Keyworlds extends CI_Controller { // 每个点 foreach ($ra as $v) { $kwr_rank = $v->kwr_rank; - if ($v->kwr_rank == '>150') + if ($v->kwr_rank == '>150') { $kwr_rank = 100; - if (strtolower($this->config->item('site_code')) == 'gm') { - $data['rank_json'] .=-$kwr_rank . ','; - } else { - $data['rank_json'] .=$kwr_rank . ','; } + $data['rank_json'] .=$kwr_rank . ','; } $data['rank_json'] = substr($data['rank_json'], 0, -1); $data['rank_json'] .=']},'; @@ -119,13 +116,10 @@ class Keyworlds extends CI_Controller { $data['rank_json'] .='{"name":"' . $ra[$data_time[0]]->kw_keyworlds . '(mobile)","data":['; foreach ($ra as $v) { $kwr_mobile_rank = $v->kwr_mobile_rank ? $v->kwr_mobile_rank : 'null' ; - if ($v->kwr_mobile_rank == '>150') + if ($v->kwr_mobile_rank == '>150') { $kwr_mobile_rank = 100; - if (strtolower($this->config->item('site_code')) == 'gm') { - $data['rank_json'] .=-$kwr_mobile_rank . ','; - } else { - $data['rank_json'] .=$kwr_mobile_rank . ','; } + $data['rank_json'] .= $kwr_mobile_rank . ','; } $data['rank_json'] = substr($data['rank_json'], 0, -1); $data['rank_json'] .=']},'; @@ -135,16 +129,15 @@ class Keyworlds extends CI_Controller { $data['data_time'] = json_encode($data_time); $data['rank_info'] = ''; isset($rank_json[$data['current_keyworld']->kw_id]) && $data['rank_info'] = $rank_json[$data['current_keyworld']->kw_id]; - arsort($data['rank_info']); + if($data['wordcount'] == 1) { + arsort($data['rank_info']); + } } } else { redirect(site_url("Keyworlds/index")); } - // $data['analytics'] = $this->analytics_model->get_keyword_analytics($data['current_keyworld']->kw_keyworlds, 30); $data['site_code'] = strtolower($this->config->item('site_code')); -// print_r($data['rank_info']); -// print_r($data["rank_json"]); $this->load->view('bootstrap/header', $data); $this->load->view('keyworlds/index'); $this->load->view('bootstrap/footer'); @@ -296,14 +289,14 @@ class Keyworlds extends CI_Controller { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); // 仅更新一个字段 - if ($client_flag == 'm') { + if ($client_flag === 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { $rank['rank_m'] = null; $rank['source_m'] = null; } - if ($rank[$rank_flag] != 0) { + if (intval($rank[$rank_flag]) != 0) { if ($rank[$rank_flag] > 150) $rank[$rank_flag] = '151'; break; @@ -315,9 +308,7 @@ class Keyworlds extends CI_Controller { } } //保存排名数据 - if ($rank[$rank_flag] == '151') { //超过151的排名则不记录 - $this->Keywords_model->update_time($kw_id); - } elseif (isset($last_rank[0]->kwr_datetime) and $last_rank[0]->kwr_datetime > strtotime(date('Y-m-d'))) { + if (isset($last_rank[0]->kwr_datetime) and $last_rank[0]->kwr_datetime > strtotime(date('Y-m-d'))) { if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->update_rank($last_rank[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'])) { $this->Keywords_model->update_time($kw_id); } @@ -343,23 +334,24 @@ class Keyworlds extends CI_Controller { $site_config = $this->config->item('site'); $engines = trim($engines); //取出需要更新排名的关键词 - $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); - //如果没有需要更新的则返回 - if (empty($worldsList)) { - echo 'all done'; - return; - } - $today = strtotime(date('Y-m-d')); + // 先取时间最久没更新的 + $worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code); + $today = strtotime(date('Y-m-d')); $client_flag = "PC"; $rank_flag = 'rank'; $source_flag = 'source'; - if ((intval($worldsList[0]->kwr_datetime) >= intval($today)) ) { + if (empty($worldsList)) { + $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); $client_flag = "m"; $rank_flag = 'rank_m'; $source_flag = 'source_m'; + $last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); + } + //如果没有需要更新的则返回 + if (empty($worldsList)) { + echo 'all done'; + return; } - $last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); - //获取排名并保存 foreach ($worldsList as $v) { $site_config = $site_config[$v->kw_sitecode]; @@ -372,8 +364,7 @@ class Keyworlds extends CI_Controller { } else if ($engines == 'yandex') {//俄语站的yangdex $rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); } - - if ($client_flag == 'm') { + if ($client_flag === 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; } else { @@ -381,26 +372,26 @@ class Keyworlds extends CI_Controller { $rank['source_m'] = null; } if ($rank[$rank_flag] != 0) { - if ($rank[$rank_flag] > 150) + if (intval($rank[$rank_flag]) > 150) $rank[$rank_flag] = '151'; break; }elseif ($i == 15) { $rank[$rank_flag] = '151'; + break; } elseif ($rank[$rank_flag] == -2) { break; } } - if ($rank[$rank_flag] == '151') { //超过151的排名则不记录 - $this->Keywords_model->update_time($v->kw_id); - }else if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) { - $this->load->model('InfoSMS_model'); - $last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank']; - $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); - $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank, (string) ($rank['rank'] - $last_rank)); - if ($engines != 'yandex') - $this->Keywords_model->update_time($v->kw_id); - } - } + if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) { + $this->load->model('InfoSMS_model'); + $last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank']; + $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); + $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank, (string) ($rank['rank'] - $last_rank)); + if ($engines != 'yandex') + $this->Keywords_model->update_time($v->kw_id); + } + } + var_dump("rank $client_flag " . $rank[$rank_flag]); var_dump($worldsList[0]->kw_keyworlds, $rank); } diff --git a/application/models/infokeywords_model.php b/application/models/infokeywords_model.php index 9c23fbd1..0e9a04a1 100644 --- a/application/models/infokeywords_model.php +++ b/application/models/infokeywords_model.php @@ -64,11 +64,14 @@ class infoKeywords_model extends CI_Model } //获取关键词列表用于抓取排名 - public function get_keyworld_list($top=1,$engines='',$site_code=false) + public function get_keyworld_list_old($top = 1, $engines='',$site_code=false) { $today = strtotime(date('Y-m-d')); + //只查某个站点,原因是个事业部服务器分开,只需要查询本事业部站点即可 $map = " "; - if ($engines=='yandex') { + if(!empty($site_code)){ + $map.=" AND kw_sitecode in ('$site_code') "; + }else if ($engines=='yandex') { $map=" AND kw_sitecode='ru' "; }elseif ($engines=='baidu') { $map.=" AND kw_sitecode='wt' "; @@ -77,9 +80,35 @@ class infoKeywords_model extends CI_Model }elseif ($engines=='eu') { $map.=" AND kw_sitecode in ('gm','vc','vac','ru','it','jp') "; } + $sql = "SELECT TOP 1 kw_id, + kw_keyworlds, + kw_is_id, + kw_sitecode, + kw_datetime, + kw_status + FROM infoKeywords + WHERE kw_status=1 AND kw_datetime<'$today' $map + ORDER BY kw_datetime asc"; + + $query = $this->HT->query($sql); + $result = $query->result(); + return $result; + } + public function get_keyworld_list($top=1,$engines='',$site_code=false) + { + $today = strtotime(date('Y-m-d')); + $map = " "; //只查某个站点,原因是个事业部服务器分开,只需要查询本事业部站点即可 if(!empty($site_code)){ $map.=" AND kw_sitecode in ('$site_code') "; + }else if ($engines=='yandex') { + $map=" AND kw_sitecode='ru' "; + }elseif ($engines=='baidu') { + $map.=" AND kw_sitecode='wt' "; + }elseif ($engines=='en') { + $map.=" AND kw_sitecode in ('cht','ct','sht','tbt','yz','gl','mbj','dct','mct','bht','ah') "; + }elseif ($engines=='eu') { + $map.=" AND kw_sitecode in ('gm','vc','vac','ru','it','jp') "; } $sql = "SELECT TOP $top kw_id, kw_keyworlds, @@ -93,10 +122,9 @@ class infoKeywords_model extends CI_Model kwr_id FROM infoKeywords INNER JOIN infoKeywordsrank ON kwr_kw_id=kw_id AND kwr_id = ( SELECT MAX(kwr_id) FROM infoKeywordsrank WHERE kwr_kw_id=kw_id ) - AND (kwr_datetime<'$today' - OR kwr_mobile_rank IS NULL OR kwr_mobile_rank=0) + AND (kwr_mobile_rank=0 OR kwr_mobile_rank IS NULL) WHERE kw_status=1 $map - ORDER BY kwr_datetime ASC"; + ORDER BY kw_datetime ASC "; $query = $this->HT->query($sql); //print_r($this->HT->queries); $result = $query->result(); diff --git a/application/views/keyworlds/index.php b/application/views/keyworlds/index.php index 979c8b6b..8b943bf2 100644 --- a/application/views/keyworlds/index.php +++ b/application/views/keyworlds/index.php @@ -346,22 +346,6 @@ }, series: }); - - - $(".highcharts-data-labels>g").each(function(){ - var tspan=$(this).find('tspan'); - var olenum=tspan.text(); - var nuewnum=0-(olenum); - tspan.text(nuewnum); - }); - $(".highcharts-axis-labels>text>tspan").each(function(){ - var olenum=$(this).text(); - var nuewnum=olenum<0?0-(olenum):olenum; - if (!$(this).parent("text").attr("transform")) { - $(this).text(nuewnum); - } - }); - }); From 55f10fa64a64daa5e00413f19a71b6c4c10a94ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Tue, 31 Oct 2017 15:14:43 +0800 Subject: [PATCH 16/55] =?UTF-8?q?=E6=9B=B4=E6=96=B0ta=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E4=BB=A3=E7=90=86=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/tripadvisor_spider/controllers/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/third_party/tripadvisor_spider/controllers/index.php b/application/third_party/tripadvisor_spider/controllers/index.php index 4697c747..bbffd659 100644 --- a/application/third_party/tripadvisor_spider/controllers/index.php +++ b/application/third_party/tripadvisor_spider/controllers/index.php @@ -37,7 +37,7 @@ class Index extends CI_Controller { if($nation_item=='www.tripadvisor.com'){//分页代码,英文站点查询前三页,反过来查询,越早的越在后面 $page_mark = array('-or20-', '-or10-', '-'); //使用代理来请求,国内直接访问会很慢 - $page_url=str_replace('https://www.tripadvisor.com', 'http://47.91.16.199:5052', $page_url); + $page_url=str_replace('https://www.tripadvisor.com', 'http://116.251.210.172:5052', $page_url); }else{ $page_mark = array('-'); } From 880686768dba1eaae6b77115843882274f471216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Tue, 31 Oct 2017 15:15:51 +0800 Subject: [PATCH 17/55] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8F=90=E4=BA=A4=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e721c211..c4ecb2c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ /kcfinder/upload/* /kcfinder/cache/* */cache/* - +/author/document/* From cdf13511ce2b3d1f65e8350bb200446a6dceb839 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 09:30:30 +0800 Subject: [PATCH 18/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E5=8E=9F=E5=A7=8B=E7=9A=84=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index aaa0aca5..cc98c2cf 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -284,10 +284,12 @@ class Keyworlds extends CI_Controller { $source_flag = 'source_m'; } + $orignal = array(); //获取排名详细情况,排名超过150的停止搜索 for ($i = 1; $i <= 15; $i++) { $j = $i; $rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); + $orignal[] = $rank['orignal']; // 仅更新一个字段 if ($client_flag === 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; @@ -318,10 +320,11 @@ class Keyworlds extends CI_Controller { } } $data[] = array( - 'name' => 'rank', - 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), - 'real' => $rank_flag . " : " . $rank[$rank_flag], - 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag + 'name' => 'rank', + 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), + 'real' => $rank_flag . " : " . $rank[$rank_flag], + 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag, + 'orignal' => $orignal ); echo json_encode($data); return TRUE; @@ -403,6 +406,7 @@ class Keyworlds extends CI_Controller { $rank['rank_m'] = 0; $rank['source_m'] = $site_url; $rank['engines'] = 'google'; + $rank["orignal"] = ''; if ($page > 3) { $rank['rank'] = 151; $rank['rank_m'] = 151; @@ -441,6 +445,7 @@ class Keyworlds extends CI_Controller { $source_flag = 'source_m'; } $response = $this->curl($url,$client_flag); + $rank["orignal"] = $response; if ($response) { //分析google搜索结果,计算排名 if (false !== stripos($response, '

302 Moved

') || From 1527977fd685343eb40842f391e641b06fe5218b Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 09:46:48 +0800 Subject: [PATCH 19/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/infokeywords_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/infokeywords_model.php b/application/models/infokeywords_model.php index 0e9a04a1..9ea6d73b 100644 --- a/application/models/infokeywords_model.php +++ b/application/models/infokeywords_model.php @@ -87,7 +87,7 @@ class infoKeywords_model extends CI_Model kw_datetime, kw_status FROM infoKeywords - WHERE kw_status=1 AND kw_datetime<'$today' $map + WHERE kw_status=1 AND kw_datetime<(SELECT DATEDIFF(S,'1970-01-01', GETDATE())) $map ORDER BY kw_datetime asc"; $query = $this->HT->query($sql); From a5190486c6366b612393d9bb3c89d7ed05302ca3 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 10:30:46 +0800 Subject: [PATCH 20/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=AE=B0?= =?UTF-8?q?=E5=BD=95PC=E6=8E=92=E5=90=8D=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index cc98c2cf..0f920eb1 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -46,7 +46,6 @@ class Keyworlds extends CI_Controller { //查询当前关键词的排名情况 $data['rank_json'] = ''; $data['current_keyworld'] = $this->Keywords_model->get_keyworld_bytreeid($kw_is_id); - //如果是根目录,则展示最新关键词排名变化情况 if ($root_key) { $data['compare_rank'] = $this->Keywords_model->get_compare_rank($data['order']); @@ -334,6 +333,7 @@ class Keyworlds extends CI_Controller { public function get_auto_rank($engines = '', $fix_site_code = '') { set_time_limit(60); $rank = array(); + $orignal = array(); $site_config = $this->config->item('site'); $engines = trim($engines); //取出需要更新排名的关键词 @@ -367,6 +367,7 @@ class Keyworlds extends CI_Controller { } else if ($engines == 'yandex') {//俄语站的yangdex $rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); } + $orignal[] = $rank['orignal']; if ($client_flag === 'm') { $rank['rank'] = $last_rank[0]->kwr_rank; $rank['source'] = $last_rank[0]->kwr_source; @@ -385,17 +386,23 @@ class Keyworlds extends CI_Controller { break; } } - if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) { + if ($rank[$rank_flag] != -1 + and $rank[$rank_flag] != -2 + and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) + and $client_flag === 'PC' + ) { $this->load->model('InfoSMS_model'); $last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank']; $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank, (string) ($rank['rank'] - $last_rank)); - if ($engines != 'yandex') + if ($engines != 'yandex') { $this->Keywords_model->update_time($v->kw_id); + } } } var_dump("rank $client_flag " . $rank[$rank_flag]); - var_dump($worldsList[0]->kw_keyworlds, $rank); + unset($rank['orignal']); + var_dump($worldsList[0]->kw_keyworlds, $rank, $orignal); } //计算关键词在google搜索引擎的排名 From c5405b2ff53ee5a5ebb52fea1179e1b86fded83f Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 10:41:17 +0800 Subject: [PATCH 21/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=9A=84=E6=8E=92=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 0f920eb1..729ea37d 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -388,8 +388,8 @@ class Keyworlds extends CI_Controller { } if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 - and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) and $client_flag === 'PC' + and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) ) { $this->load->model('InfoSMS_model'); $last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank']; @@ -398,7 +398,12 @@ class Keyworlds extends CI_Controller { if ($engines != 'yandex') { $this->Keywords_model->update_time($v->kw_id); } - } + } else if ($rank[$rank_flag] != -1 + and $rank[$rank_flag] != -2 + and $client_flag === 'm') { + $this->Keywordsrank_model->update_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + $this->Keywords_model->update_time($v->kw_id); + } } var_dump("rank $client_flag " . $rank[$rank_flag]); unset($rank['orignal']); From 7e49b2487722dfc93e6d8c120733ddf8c40a8766 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 10:46:32 +0800 Subject: [PATCH 22/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=9A=84=E6=8E=92=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 729ea37d..187d6b92 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -401,7 +401,7 @@ class Keyworlds extends CI_Controller { } else if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $client_flag === 'm') { - $this->Keywordsrank_model->update_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + $this->Keywordsrank_model->update_rank($last_rank[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); $this->Keywords_model->update_time($v->kw_id); } } From be3249dfc1ad28f3a84f4dc4d4d63b0d804fbe86 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 10:58:27 +0800 Subject: [PATCH 23/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=97=A7=E6=8E=92=E5=90=8D,=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=8E=92=E5=90=8D=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 187d6b92..1dd7d005 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -392,9 +392,10 @@ class Keyworlds extends CI_Controller { and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) ) { $this->load->model('InfoSMS_model'); - $last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank']; + $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); + $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); - $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank, (string) ($rank['rank'] - $last_rank)); + $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); if ($engines != 'yandex') { $this->Keywords_model->update_time($v->kw_id); } From 8d8b8bcae7f05900917a6f95698cf86afa3339c7 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 11:04:27 +0800 Subject: [PATCH 24/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=97=A7=E6=8E=92=E5=90=8D,=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=8E=92=E5=90=8D=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 1dd7d005..c4098f35 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -338,11 +338,12 @@ class Keyworlds extends CI_Controller { $engines = trim($engines); //取出需要更新排名的关键词 // 先取时间最久没更新的 - $worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code); - $today = strtotime(date('Y-m-d')); - $client_flag = "PC"; - $rank_flag = 'rank'; - $source_flag = 'source'; + $worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code); + $today = strtotime(date('Y-m-d')); + $client_flag = "PC"; + $rank_flag = 'rank'; + $source_flag = 'source'; + $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); if (empty($worldsList)) { $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); $client_flag = "m"; @@ -392,7 +393,6 @@ class Keyworlds extends CI_Controller { and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) ) { $this->load->model('InfoSMS_model'); - $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); From 85fad91ba13e6d9a138b55ac0b052803bd8b2d00 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 15:17:21 +0800 Subject: [PATCH 25/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index c4098f35..1ab9cc97 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -449,11 +449,11 @@ class Keyworlds extends CI_Controller { //抓取google搜索结果 $url = "https://www.$google_url/search?q=$search_worlds&start=$start&num=50&hl=$language"; - $match_fun = '/

(.*)<\/h3>/smUi'; + $match_fun = '/

(.*)<\/h3>/smUi'; $rank_flag = 'rank'; $source_flag = 'source'; if ($client_flag == 'm') { - $match_fun = '/ Date: Wed, 1 Nov 2017 15:37:43 +0800 Subject: [PATCH 26/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=9C=AC=E5=9C=B0=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 1ab9cc97..23b89e4b 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -663,8 +663,8 @@ class Keyworlds extends CI_Controller { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); - curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); - curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 + // curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); + // curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 if ($referer) { curl_setopt($ch, CURLOPT_REFERER, $referer); } From 6f0c8cf407f91ad291a42085e89c3ca3b3ae818f Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 15:42:13 +0800 Subject: [PATCH 27/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20Google?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 23b89e4b..097d21fc 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -462,7 +462,7 @@ class Keyworlds extends CI_Controller { if ($response) { //分析google搜索结果,计算排名 if (false !== stripos($response, '

302 Moved

') || - false !== stripos($response, 'captcha')) { + false !== stripos($response, 'recaptcha')) { $rank['rank'] = -2; } elseif (false !== stripos($response, $site_url)) { preg_match_all($match_fun, $response, $store); From 8caa2437303c689b807d3959a3e96899af5ecf66 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 16:45:03 +0800 Subject: [PATCH 28/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BD=AC=E4=B9=89=E5=90=8E=E7=9A=84=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 097d21fc..ef957240 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -468,6 +468,7 @@ class Keyworlds extends CI_Controller { preg_match_all($match_fun, $response, $store); foreach ($store[1] as $k => $v) { $ismatch = stripos($v, $site_url); + $ismatch = $ismatch ? $ismatch : stripos($v, addcslashes(addslashes($site_url), "/")); if (false !== $ismatch) { //计算排名 $rank[$rank_flag] = $start + $k + 1; @@ -531,6 +532,7 @@ class Keyworlds extends CI_Controller { preg_match_all($match_fun, $response, $store); foreach ($store[1] as $k => $v) { $start_s = stripos($v, $site_url); + $start_s = $start_s ? $start_s : stripos($v, addcslashes(addslashes($site_url), "/")); if (false !== $start_s) { $rank[$rank_flag] = $startrank + $k + 1; $end_s = stripos($v, '" ', $start_s); From 9d83c6af4d31e474fc7d3a5fd6fbbe90a952e797 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 17:27:54 +0800 Subject: [PATCH 29/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index ef957240..cf9cd359 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -323,7 +323,8 @@ class Keyworlds extends CI_Controller { 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), 'real' => $rank_flag . " : " . $rank[$rank_flag], 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag, - 'orignal' => $orignal + 'orignal' => $orignal, + "site" => $site_url ); echo json_encode($data); return TRUE; From 3e115a7050d2b6edaf64e85b7145f286d4cff703 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 1 Nov 2017 17:32:09 +0800 Subject: [PATCH 30/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index cf9cd359..6376ca99 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -323,7 +323,7 @@ class Keyworlds extends CI_Controller { 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), 'real' => $rank_flag . " : " . $rank[$rank_flag], 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag, - 'orignal' => $orignal, + // 'orignal' => $orignal, "site" => $site_url ); echo json_encode($data); From 0794fe27948581f3f65038860bb4d2e03f7a1f9a Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 2 Nov 2017 16:46:38 +0800 Subject: [PATCH 31/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=20kwr=5Fkw?= =?UTF-8?q?=5Fid=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 6376ca99..2757ca9e 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -347,16 +347,16 @@ class Keyworlds extends CI_Controller { $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); if (empty($worldsList)) { $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); + //如果没有需要更新的则返回 + if (empty($worldsList)) { + echo 'all done'; + return; + } $client_flag = "m"; $rank_flag = 'rank_m'; $source_flag = 'source_m'; $last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); } - //如果没有需要更新的则返回 - if (empty($worldsList)) { - echo 'all done'; - return; - } //获取排名并保存 foreach ($worldsList as $v) { $site_config = $site_config[$v->kw_sitecode]; From 7210011976255e5540fc4e23e7fe37cbafaa3daa Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 2 Nov 2017 16:49:53 +0800 Subject: [PATCH 32/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=20kwr=5Fkw?= =?UTF-8?q?=5Fid=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 2757ca9e..397fefaf 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -344,7 +344,6 @@ class Keyworlds extends CI_Controller { $client_flag = "PC"; $rank_flag = 'rank'; $source_flag = 'source'; - $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); if (empty($worldsList)) { $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); //如果没有需要更新的则返回 @@ -357,6 +356,7 @@ class Keyworlds extends CI_Controller { $source_flag = 'source_m'; $last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); } + $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); //获取排名并保存 foreach ($worldsList as $v) { $site_config = $site_config[$v->kw_sitecode]; From 82ecc7da5d2bda906b8117089261966af3c38a9a Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 3 Nov 2017 10:42:40 +0800 Subject: [PATCH 33/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 397fefaf..9fd4fa72 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -689,4 +689,13 @@ class Keyworlds extends CI_Controller { return $reponse; } + public function test($kw_is_id=0, $top=1) + { + $rank_info = $this->Keywordsrank_model->get_rank_list($is_id_string, $top); + foreach ($rank_info as $key => &$value) { + $rank_info['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime); + } + var_dump($rank_info); + } + } From 0380140807249c04f485c376638514a9611a18c5 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 3 Nov 2017 10:43:21 +0800 Subject: [PATCH 34/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 9fd4fa72..b8e4762d 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -689,7 +689,7 @@ class Keyworlds extends CI_Controller { return $reponse; } - public function test($kw_is_id=0, $top=1) + public function testrank($kw_is_id=0, $top=1) { $rank_info = $this->Keywordsrank_model->get_rank_list($is_id_string, $top); foreach ($rank_info as $key => &$value) { From 8a98510646c4ca9783610a9f4a95bfbc8c485510 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 3 Nov 2017 10:44:26 +0800 Subject: [PATCH 35/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index b8e4762d..5d6225f8 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -691,7 +691,7 @@ class Keyworlds extends CI_Controller { public function testrank($kw_is_id=0, $top=1) { - $rank_info = $this->Keywordsrank_model->get_rank_list($is_id_string, $top); + $rank_info = $this->Keywordsrank_model->get_rank_list($kw_is_id, $top); foreach ($rank_info as $key => &$value) { $rank_info['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime); } From 1f68f3e2e1a481efd8ad999af63d6c32c39274d7 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 3 Nov 2017 10:44:50 +0800 Subject: [PATCH 36/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 5d6225f8..702ab929 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -693,7 +693,7 @@ class Keyworlds extends CI_Controller { { $rank_info = $this->Keywordsrank_model->get_rank_list($kw_is_id, $top); foreach ($rank_info as $key => &$value) { - $rank_info['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime); + $value['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime); } var_dump($rank_info); } From 5162c9fd28108a3c7d80780db5ee92f14b6e62aa Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 3 Nov 2017 11:02:17 +0800 Subject: [PATCH 37/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 702ab929..695d57d5 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -691,7 +691,9 @@ class Keyworlds extends CI_Controller { public function testrank($kw_is_id=0, $top=1) { - $rank_info = $this->Keywordsrank_model->get_rank_list($kw_is_id, $top); + $data['current_keyworld'] = $this->Keywords_model->get_keyworld_bytreeid($kw_is_id); + $is_id_string = $data['current_keyworld']->kw_id; + $rank_info = $this->Keywordsrank_model->get_rank_list($is_id_string, $top); foreach ($rank_info as $key => &$value) { $value['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime); } From f0fd78bbf91f8c5db84ecb940b1160adad2745a0 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 8 Nov 2017 11:57:46 +0800 Subject: [PATCH 38/55] =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8E=92=E5=90=8D=E5=A2=9E=E5=8A=A0=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 114 ++++++++++++++++---------- 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 695d57d5..61769f65 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -283,6 +283,10 @@ class Keyworlds extends CI_Controller { $source_flag = 'source_m'; } + $today_0 = strtotime(date('Ymd000000')); + $today_24 = strtotime(date('Ymd235959')); + $last_rank_today = $this->Keywordsrank_model->get_rank_list($kw_id,1,$today_0,$today_24); + $orignal = array(); //获取排名详细情况,排名超过150的停止搜索 for ($i = 1; $i <= 15; $i++) { @@ -291,11 +295,11 @@ class Keyworlds extends CI_Controller { $orignal[] = $rank['orignal']; // 仅更新一个字段 if ($client_flag === 'm') { - $rank['rank'] = $last_rank[0]->kwr_rank; - $rank['source'] = $last_rank[0]->kwr_source; + $rank['rank'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_rank : null; + $rank['source'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_source : null; } else { - $rank['rank_m'] = null; - $rank['source_m'] = null; + $rank['rank_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_rank : null; + $rank['source_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_source : null; } if (intval($rank[$rank_flag]) != 0) { if ($rank[$rank_flag] > 150) @@ -308,43 +312,55 @@ class Keyworlds extends CI_Controller { break; } } + $data[] = array( + 'name' => 'rank', + 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), + 'real' => $rank_flag . " : " . $rank[$rank_flag] + // ,'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag + // ,'orignal' => $orignal + // ,"site" => $site_url + ); + if ($rank[$rank_flag] < 0) { + echo json_encode($data); + return false; + } //保存排名数据 - if (isset($last_rank[0]->kwr_datetime) and $last_rank[0]->kwr_datetime > strtotime(date('Y-m-d'))) { - if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->update_rank($last_rank[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'])) { - $this->Keywords_model->update_time($kw_id); - } + if ( isset($last_rank_today[0]) && ! empty($last_rank_today[0])) { + $this->Keywordsrank_model->update_rank($last_rank_today[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + $this->Keywords_model->update_time($kw_id); } else { - if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) { + $add = $this->Keywordsrank_model->add_rank($kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + // rank 变化 + if ($add && $client_flag === 'PC') { + $this->load->model('InfoSMS_model'); + $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $this->InfoSMS_model->readed_for_info($kw_id, 'keywords_rank'); + $this->InfoSMS_model->add('keywords_rank', $kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); $this->Keywords_model->update_time($kw_id); } } - $data[] = array( - 'name' => 'rank', - 'value' => ($rank['rank'] . " / " . $rank["rank_m"]), - 'real' => $rank_flag . " : " . $rank[$rank_flag], - 'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag, - // 'orignal' => $orignal, - "site" => $site_url - ); echo json_encode($data); return TRUE; } //自动爬取排名 - public function get_auto_rank($engines = '', $fix_site_code = '') { + public function get_auto_rank($engines = '', $fix_site_code = '', $client='PC') { set_time_limit(60); - $rank = array(); - $orignal = array(); + $rank = array(); + $orignal = array(); + $worldsList = array(); $site_config = $this->config->item('site'); - $engines = trim($engines); + $engines = trim($engines); //取出需要更新排名的关键词 // 先取时间最久没更新的 - $worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code); $today = strtotime(date('Y-m-d')); - $client_flag = "PC"; + $client_flag = $client ? $client : "PC"; $rank_flag = 'rank'; $source_flag = 'source'; - if (empty($worldsList)) { + if ($client_flag == 'PC') { + $worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code); + } + if (empty($worldsList) || $client_flag === 'm') { $worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code); //如果没有需要更新的则返回 if (empty($worldsList)) { @@ -357,6 +373,11 @@ class Keyworlds extends CI_Controller { $last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); } $last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id); + + $today_0 = strtotime(date('Ymd000000')); + $today_24 = strtotime(date('Ymd235959')); + $last_rank_today = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id,1,$today_0,$today_24); + //获取排名并保存 foreach ($worldsList as $v) { $site_config = $site_config[$v->kw_sitecode]; @@ -371,11 +392,11 @@ class Keyworlds extends CI_Controller { } $orignal[] = $rank['orignal']; if ($client_flag === 'm') { - $rank['rank'] = $last_rank[0]->kwr_rank; - $rank['source'] = $last_rank[0]->kwr_source; + $rank['rank'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_rank : null; + $rank['source'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_source : null; } else { - $rank['rank_m'] = null; - $rank['source_m'] = null; + $rank['rank_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_rank : null; + $rank['source_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_source : null; } if ($rank[$rank_flag] != 0) { if (intval($rank[$rank_flag]) > 150) @@ -388,23 +409,24 @@ class Keyworlds extends CI_Controller { break; } } - if ($rank[$rank_flag] != -1 - and $rank[$rank_flag] != -2 - and $client_flag === 'PC' - and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']) - ) { - $this->load->model('InfoSMS_model'); - $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; - $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); - $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); - if ($engines != 'yandex') { - $this->Keywords_model->update_time($v->kw_id); - } - } else if ($rank[$rank_flag] != -1 - and $rank[$rank_flag] != -2 - and $client_flag === 'm') { - $this->Keywordsrank_model->update_rank($last_rank[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + if ( $rank[$rank_flag] < 0 ) { + break; + } + if ( isset($last_rank_today[0]) && ! empty($last_rank_today[0])) { + $this->Keywordsrank_model->update_rank($last_rank_today[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); $this->Keywords_model->update_time($v->kw_id); + } else { + $add = $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']); + // rank 变化 + if ($add && $client_flag === 'PC') { + $this->load->model('InfoSMS_model'); + $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); + $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); + if ($engines != 'yandex') { + $this->Keywords_model->update_time($v->kw_id); + } + } } } var_dump("rank $client_flag " . $rank[$rank_flag]); @@ -459,12 +481,12 @@ class Keyworlds extends CI_Controller { $source_flag = 'source_m'; } $response = $this->curl($url,$client_flag); - $rank["orignal"] = $response; if ($response) { //分析google搜索结果,计算排名 if (false !== stripos($response, '

302 Moved

') || false !== stripos($response, 'recaptcha')) { $rank['rank'] = -2; + $rank["orignal"] = $response; } elseif (false !== stripos($response, $site_url)) { preg_match_all($match_fun, $response, $store); foreach ($store[1] as $k => $v) { @@ -482,9 +504,11 @@ class Keyworlds extends CI_Controller { } } } else { + $rank["orignal"] = $response; // log_message('error','google search response not found CH'); } } else { + $rank["orignal"] = $response; $rank[$rank_flag] = -1; } return $rank; From c3e93587cee300237e08f9eb673e2977b04ac760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 10 Nov 2017 10:37:06 +0800 Subject: [PATCH 39/55] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= 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, 2 insertions(+), 1 deletion(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 59c7b75f..763d01e7 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -15,7 +15,8 @@ class search extends CI_Controller{ if(!$train_date || !$fromStation || !$toStation){ exit('传参错误!'); }else{ - $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; $back_data = $this->get_http($url); if(empty(json_decode($back_data)->result)){ From 672f71110d6d286613eb53e90097382d344d33e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 10 Nov 2017 10:59:41 +0800 Subject: [PATCH 40/55] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=AD=98=E7=81=AB?= =?UTF-8?q?=E8=BD=A6=E4=BB=B7=E6=A0=BC=E5=92=8C=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E5=BF=AB=E6=90=9C=E7=B4=A2=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/train/controllers/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 763d01e7..63dc51c1 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");//加载模型 } //查询聚合余票接口,对返回的数据进行处理 @@ -103,7 +103,7 @@ 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)); + //$this->BIZ_train_model->addOrUpdate($value->train_no,$value->train_code,$value->from_station_code,$value->to_station_code,json_encode($data)); $i++; } } From 53c1769347f895041bea75f446e8dbaa970603e6 Mon Sep 17 00:00:00 2001 From: "lmr@hainatravel.com" <59361885@qq.com> Date: Fri, 10 Nov 2017 16:47:59 +0800 Subject: [PATCH 41/55] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=82=A3=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=B7=E5=BC=8Ffinx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lmrxedit/template/0.php | 4 ++-- lmrxedit/template/1.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lmrxedit/template/0.php b/lmrxedit/template/0.php index 04342d85..1f576fce 100644 --- a/lmrxedit/template/0.php +++ b/lmrxedit/template/0.php @@ -7,7 +7,7 @@ - + @@ -1350,5 +1351,9 @@ $('.newTagA').html(' + 新标签 ').show(); } }); + //添加新模板 + $('#newTemp').on('click', function() { + alert('ok'); + }); \ No newline at end of file From 88250f861d7e26f5ccfb0cf74ef3ae514e0d4262 Mon Sep 17 00:00:00 2001 From: "lmr@hainatravel.com" <59361885@qq.com> Date: Mon, 20 Nov 2017 10:48:56 +0800 Subject: [PATCH 51/55] test --- application/views/bootstrap3/information_edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index ce2b4b37..3fe01bd8 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -1296,8 +1296,8 @@
From 851bfaa13a6f1cf89d5a9f4592db22187c94d587 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 27 Nov 2017 14:27:14 +0800 Subject: [PATCH 52/55] =?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 53/55] =?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 54/55] =?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 55/55] =?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 +}