Merge branch 'master' of git.mycht.cn:developers/information-system

hotfix/远程访问多媒体中心
cyc 8 years ago
commit b5918f624a

@ -102,7 +102,8 @@ class Keyworlds extends CI_Controller {
$data['rank_json'] .='{"name":"' . $ra[$data_time[0]]->kw_keyworlds . '","data":[';
// 每个点
foreach ($ra as $v) {
$kwr_rank = $v->kwr_rank;
$kwr_rank = $v->kwr_rank ? $v->kwr_rank : 'null';
$kwr_rank = ($v->kwr_rank==151) ? 'null' : $v->kwr_rank;
if ($v->kwr_rank == '>150') {
$kwr_rank = 100;
}
@ -115,6 +116,7 @@ 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' ;
$kwr_mobile_rank = ($v->kwr_mobile_rank==151) ? 'null' : $v->kwr_mobile_rank;
if ($v->kwr_mobile_rank == '>150') {
$kwr_mobile_rank = 100;
}
@ -286,6 +288,7 @@ class Keyworlds extends CI_Controller {
$today_0 = strtotime(date('Ymd000000'));
$today_24 = strtotime(date('Ymd235959'));
$last_rank_today = $this->Keywordsrank_model->get_rank_list($kw_id,1,$today_0,$today_24);
// $last_rank_today = $last_rank;
$orignal = array();
//获取排名详细情况,排名超过150的停止搜索
@ -316,6 +319,7 @@ class Keyworlds extends CI_Controller {
'name' => 'rank',
'value' => ($rank['rank'] . " / " . $rank["rank_m"]),
'real' => $rank_flag . " : " . $rank[$rank_flag]
// ,'lastid' => $last_rank[0]->kwr_id . " / " . $last_rank_todaytmp[0]->kwr_id
// ,'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag
// ,'orignal' => $orignal
// ,"site" => $site_url
@ -330,14 +334,14 @@ class Keyworlds extends CI_Controller {
$this->Keywords_model->update_time($kw_id);
} else {
$add = $this->Keywordsrank_model->add_rank($kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
// rank 变化
if ($add && $client_flag === 'PC') {
$this->load->model('InfoSMS_model');
$last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->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));
$this->Keywords_model->update_time($kw_id);
}
}
// rank 变化
if ($client_flag === 'PC') {
$this->load->model('InfoSMS_model');
$last_rank_pc = isset($last_rank[0]) ? $last_rank[0]->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));
$this->Keywords_model->update_time($kw_id);
}
echo json_encode($data);
return TRUE;
@ -370,13 +374,13 @@ class Keyworlds extends CI_Controller {
$client_flag = "m";
$rank_flag = 'rank_m';
$source_flag = 'source_m';
$last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id);
}
$last_rank_pc = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id);
$today_0 = strtotime(date('Ymd000000'));
$today_24 = strtotime(date('Ymd235959'));
$last_rank_today = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id,1,$today_0,$today_24);
// $last_rank_today = $last_rank_pc;
//获取排名并保存
foreach ($worldsList as $v) {
@ -417,15 +421,15 @@ class Keyworlds extends CI_Controller {
$this->Keywords_model->update_time($v->kw_id);
} else {
$add = $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
// rank 变化
if ($add && $client_flag === 'PC') {
$this->load->model('InfoSMS_model');
$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));
if ($engines != 'yandex') {
$this->Keywords_model->update_time($v->kw_id);
}
}
// rank 变化
if ($client_flag === 'PC') {
$this->load->model('InfoSMS_model');
$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));
if ($engines != 'yandex') {
$this->Keywords_model->update_time($v->kw_id);
}
}
}

@ -80,6 +80,7 @@ class infoKeywords_model extends CI_Model
}elseif ($engines=='eu') {
$map.=" AND kw_sitecode in ('gm','vc','vac','ru','it','jp') ";
}
$today0 = strtotime(date('Ymd000000'));
$sql = "SELECT TOP 1 kw_id,
kw_keyworlds,
kw_is_id,
@ -87,7 +88,7 @@ class infoKeywords_model extends CI_Model
kw_datetime,
kw_status
FROM infoKeywords
WHERE kw_status=1 AND kw_datetime<(SELECT DATEDIFF(S,'1970-01-01', GETDATE())) $map
WHERE kw_status=1 AND kw_datetime<($today0) $map
ORDER BY kw_datetime asc";
$query = $this->HT->query($sql);
@ -96,7 +97,7 @@ class infoKeywords_model extends CI_Model
}
public function get_keyworld_list($top=1,$engines='',$site_code=false)
{
$today = strtotime(date('Y-m-d'));
$today0 = strtotime(date('Ymd000000'));
$map = " ";
//只查某个站点,原因是个事业部服务器分开,只需要查询本事业部站点即可
if(!empty($site_code)){
@ -121,9 +122,13 @@ class infoKeywords_model extends CI_Model
kwr_mobile_rank,
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_mobile_rank=0 OR kwr_mobile_rank IS NULL)
WHERE kw_status=1 $map
AND kwr_id = ( SELECT top 1 kwr_id FROM infoKeywordsrank WHERE kwr_kw_id=kw_id order by kwr_id desc )
WHERE kw_status=1 $map
AND (
(kw_datetime>$today0 and kwr_mobile_rank IS NULL)
or
(kw_datetime<$today0)
)
ORDER BY kw_datetime ASC ";
$query = $this->HT->query($sql);
//print_r($this->HT->queries);

@ -58,7 +58,7 @@ class infoKeywordsrank_model extends CI_Model
kw_keyworlds
FROM infoKeywordsrank LEFT JOIN infoKeywords ON kw_id=kwr_kw_id
WHERE kwr_kw_id in ($kw_id_string) $map
ORDER BY kwr_datetime DESC";
ORDER BY kwr_id DESC";
$query = $this->HT->query($sql);
return $query->result();
}

@ -65,7 +65,7 @@ class Index extends CI_Controller {
$js_jquery_content = '';
foreach ($html_object->find('script') as $link_script) {
if (!empty($link_script->src)) {
if(empty($link_script->defer)){ //没有defer标记的才处理否则让js延后加载
if(empty($link_script->defer) && empty($link_script->async)){ //没有defer标记的才处理否则让js延后加载
$link_js_array[] = $link_script->src;
$link_script->outertext = ''; //删除链接,移动到页底
}
@ -122,7 +122,7 @@ class Index extends CI_Controller {
$js_content = $js_scr_content . $js_jquery_content;
//延迟加载js需要把返回的js代码保存到一个文件中然后替换占位符以便加载js文件
$lastload_js.='<script defer src="##DEFERSCRIPTDEFER##"></script>';
$lastload_js.='<script async src="##DEFERSCRIPTDEFER##"></script>';
$lastload_js.=$js_inline_content;
$html_object = str_replace('</body>', $lastload_js . '</body>', $html_object);

@ -43,6 +43,7 @@
<div id="zhexiantu" class="span12" style="height:<?php if($wordcount==1) {echo '620px';}else{echo '1000px;';} ?>;margin-left:0;padding-right: 15px;"></div>
<?php } if (!empty($rank_info)) { ?>
<legend>排名情况</legend>
<!-- if 151, null -->
<table class="table table-striped">
<thead>
<tr>
@ -53,6 +54,7 @@
</tr>
</thead>
<tbody>
<!-- <?php echo "test"; ?> -->
<?php $ki=0; foreach ($rank_info as $k=>$rank) { ?>
<tr>
<td><?php echo ++$ki; ?></td>

Loading…
Cancel
Save