关键词 列表倒序;

hotfix/远程访问多媒体中心
lyt 8 years ago
parent 6dcb16d3e2
commit f6e2383ec1

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

@ -62,8 +62,8 @@
<br>
<a target="_blank" href="<?php echo $rank->kwr_mobile_source; ?>"><?php echo $rank->kwr_mobile_source; ?></a>
</td>
<td><?php echo $rank->kwr_rank; ?>&nbsp;--&nbsp;
<?php $kwr_mobile_rank = $rank->kwr_mobile_rank ? $rank->kwr_mobile_rank : '未抓取'; echo $kwr_mobile_rank; ?></td>
<td><?php echo $rank->kwr_rank; ?>&nbsp;&nbsp;/&nbsp;&nbsp;
<?php $kwr_mobile_rank = $rank->kwr_mobile_rank ? $rank->kwr_mobile_rank : '--'; echo $kwr_mobile_rank; ?></td>
</tr>
<?php if($k+1==7) break; ?>
<?php } ?>

Loading…
Cancel
Save