搜索结果页添加批量静态化功能

mobile-first
尹诚诚 6 years ago
parent 875e8cf6cb
commit fcb9b6973a

@ -100,6 +100,25 @@ class Welcome extends CI_Controller {
$this->load->view('bootstrap/footer');
}
}
//根据信息节点ID获取信息用于搜索结果的批量更新静态页面
public function create_infomation_urls_by_ids($view = false){
$is_ids=$this->input->get('key');
if (empty($is_ids)) {
show_404();
return false;
}
$data['all_information'] = $this->Information_model->get_detail_by_ids($is_ids);
if ($view == 'amp') {
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/refresh_amp_urls');
$this->load->view('bootstrap3/footer');
} else {
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/cache_url', $data);
$this->load->view('bootstrap/footer');
}
}
public function get_infomation_urls($is_parent_id) {
$this->output->enable_profiler(FALSE);

@ -93,6 +93,13 @@ class Information_model extends CI_Model {
$this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC ';
return $this->GetList();
}
//根据节点ID列表获取信息
function get_detail_by_ids($is_ids) {
$this->init();
$this->is_id_array = " AND is1.is_id IN ($is_ids) ";
$this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC ';
return $this->GetList();
}
//根据根节点ID获取子节点列表
function get_list_by_id($is_parent_id, $level = false) {
@ -104,6 +111,7 @@ class Information_model extends CI_Model {
$this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC ';
return $this->GetList();
}
function Detail($ic_url_is_id) {
if (empty($ic_url_is_id)) {

@ -151,7 +151,9 @@
</thead>
<tbody>
<?php
$is_ids=false;
foreach ($search_list as $key => $item) {
$is_ids.=$item->is_id.',';
?>
<tr class="<?php if(!empty($item->ic_content) && $item->ic_status==1 ){ echo 'info';} ?>">
<td><?php echo $key + 1; ?></td>
@ -162,7 +164,10 @@
</tr>
<?php } ?>
</tbody>
</table>
</table>
<?php if(!empty($is_ids)){ $is_ids.='0';?>
<p> <a href="<?php echo site_url('welcome/create_infomation_urls_by_ids/?key=' . $is_ids); ?>" target="_blank" class="btn pull-right" >批量更新搜索页面</a> </p>
<?php } ?>
<?php } ?>

Loading…
Cancel
Save