keyword 排名变化bug

hotfix/远程访问多媒体中心
lyt 8 years ago
parent c500df1f2a
commit d57f6620bc

@ -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));
}

@ -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,

Loading…
Cancel
Save