关键词 列表倒序;

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数据格式 // 拼接highcharts数据格式
$data['rank_json'] = '['; $data['rank_json'] = '[';
foreach ($rank_json as &$ra) { foreach ($rank_json as &$ra) {
@ -134,10 +132,10 @@ class Keyworlds extends CI_Controller {
} }
} }
$data['rank_json'] = substr($data['rank_json'], 0, -1) . ']'; $data['rank_json'] = substr($data['rank_json'], 0, -1) . ']';
// print_r($data['rank_json']);
$data['data_time'] = json_encode($data_time); $data['data_time'] = json_encode($data_time);
$data['rank_info'] = ''; $data['rank_info'] = '';
isset($rank_json[$data['current_keyworld']->kw_id]) && $data['rank_info'] = $rank_json[$data['current_keyworld']->kw_id]; isset($rank_json[$data['current_keyworld']->kw_id]) && $data['rank_info'] = $rank_json[$data['current_keyworld']->kw_id];
arsort($data['rank_info']);
} }
} else { } else {
redirect(site_url("Keyworlds/index")); redirect(site_url("Keyworlds/index"));
@ -297,7 +295,7 @@ class Keyworlds extends CI_Controller {
$j = $i; $j = $i;
$rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code); $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['rank'] = $last_rank[0]->kwr_rank;
$rank['source'] = $last_rank[0]->kwr_source; $rank['source'] = $last_rank[0]->kwr_source;
} else { } else {
@ -327,7 +325,11 @@ class Keyworlds extends CI_Controller {
$this->Keywords_model->update_time($kw_id); $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); echo json_encode($data);
return TRUE; return TRUE;
} }
@ -368,7 +370,8 @@ class Keyworlds extends CI_Controller {
} else if ($engines == 'yandex') {//俄语站的yangdex } else if ($engines == 'yandex') {//俄语站的yangdex
$rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1); $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['rank'] = $last_rank[0]->kwr_rank;
$rank['source'] = $last_rank[0]->kwr_source; $rank['source'] = $last_rank[0]->kwr_source;
} else { } else {
@ -648,8 +651,8 @@ class Keyworlds extends CI_Controller {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent); curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
// curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
// curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理 curl_setopt($ch, CURLOPT_PROXY, "202.103.68.28:11111"); // 本地代理
if ($referer) { if ($referer) {
curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_REFERER, $referer);
} }

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

Loading…
Cancel
Save