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 = '/