From d57f6620bc4d7047b76d935ee48e5cfcd86ad041 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 5 Feb 2018 14:55:28 +0800 Subject: [PATCH] =?UTF-8?q?keyword=20=E6=8E=92=E5=90=8D=E5=8F=98=E5=8C=96b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/keyworlds.php | 12 ++++++------ application/models/infokeywordsrank_model.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 099945ad..a6b7108c 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -341,10 +341,10 @@ class Keyworlds extends CI_Controller { // rank 变化 if ($client_flag === 'PC') { $this->Keywords_model->update_time($kw_id); - $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($kw_id); - if (trim($last_rank_pc[0]->kwr_rank) != "") { + $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($kw_id, 2); + if (trim($last_rank_pc[1]->kwr_rank) != "") { $this->load->model('InfoSMS_model'); - $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->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)); } @@ -429,10 +429,10 @@ class Keyworlds extends CI_Controller { // rank 变化 if ($client_flag === 'PC') { $this->Keywords_model->update_time($v->kw_id); - $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($v->kw_id); - if (trim($last_rank_pc[0]->kwr_rank) != "") { + $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($v->kw_id, 2); + if (trim($last_rank_pc[1]->kwr_rank) != "") { $this->load->model('InfoSMS_model'); - $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->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)); } diff --git a/application/models/infokeywordsrank_model.php b/application/models/infokeywordsrank_model.php index df0c8039..7c4e31c2 100644 --- a/application/models/infokeywordsrank_model.php +++ b/application/models/infokeywordsrank_model.php @@ -64,7 +64,7 @@ class infoKeywordsrank_model extends CI_Model } public function get_last_pc_rank($kw_id_string, $top=1) { - $sql = "SELECT top 2 kwr_id, + $sql = "SELECT top $top kwr_id, kwr_kw_id, kwr_rank, kwr_mobile_rank,