在Codeigniter中首次分页后,不会显示搜索结果

时间:2016-01-20 00:17:50

标签: php codeigniter codeigniter-3

我是Codeigniter的新手并在这里寻求帮助。

我正在制作一个带分页的测试应用程序。它工作正常,直到第一个结果,但点击“下一步”'或者'任何分页'告诉我没有找到结果。

我认为它要求网址好,但不知道还有什么问题。

http://localhost/admin/search/search-results/2

我的控制器:

Foreach ($objDistributionGroup in $objDistributionGroups) 
{     

    write-host "Processing $($objDistributionGroup.DisplayName)..." 

    #Get members of this group 
    $objDGMembers = Get-DistributionGroupMember -Identity $($objDistributionGroup.PrimarySmtpAddress) 

    write-host "Found $($objDGMembers.Count) members..." 

    #Iterate through each member 
    Foreach ($objMember in $objDGMembers) 
    { 
        Out-File -FilePath $OutputFile = "C:\DistributionGroupWithMembers" -InputObject "$($objDistributionGroup.DisplayName),$($objDistributionGroup.PrimarySMTPAddress),$($objMember.DisplayName),$($objMember.PrimarySMTPAddress),$($objMember.RecipientType)" -Encoding UTF8 -append 
        write-host "`t$($objDistributionGroup.DisplayName),$($objDistributionGroup.PrimarySMTPAddress),$($objMember.DisplayName),$($objMember.PrimarySMTPAddress),$($objMember.RecipientType)"
    } 
} 

型号:

public function pagination(){
$keyword = $this->input->post('search[1]');
$main_keyword = $this->search_model->get_city_id_by_input($keyword);

    $config['base_url'] = base_url().'search/search-results/';
    $config['total_rows'] = $this->search_model->total_number_of_rows($main_keyword);
    $config['per_page'] = 1;
    $config['use_page_numbers'] = TRUE;
    $config['num_links'] = $this->search_model->total_number_of_rows($main_keyword);
    $config['cur_tag_open'] = ' ';
    $config['next_link'] = 'Next';
    $config['prev_link'] = 'Previous';

$this->pagination->initialize($config);
$data['results'] = $this->search_model->get_search_results($main_keyword, $config['per_page'], $this->uri->segment(3));

    $this->load->view('view',$data);
}

请帮忙。

0 个答案:

没有答案