예제 #1
0
 /**
  * 列表页面
  *
  * @return void
  */
 public function index()
 {
     /** 搜索 */
     $search = array();
     $search['status != '] = '-1';
     $get = $this->input->get();
     if (!empty($get['begin_time'])) {
         $search['createtime >='] = strtotime($get['begin_time'] . "00:00:01");
     }
     if (!empty($get['end_time'])) {
         $search['createtime <='] = strtotime($get['end_time'] . "23:59:59");
     }
     if (!empty($get['keyword'])) {
         $search['title like'] = '%' . trim($get['keyword']) . '%';
     }
     $data = array();
     /** 分页连接 */
     $total = EvaluationOptionModel::get_count(array('status != ' => '-1'));
     $current_page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1;
     $per_page = 15;
     $purl = current_url();
     $data['pagination'] = multipage($total['count'], 15, $current_page, $purl);
     /** 获取数据 */
     $limit = $per_page * ($current_page - 1) . ',' . $per_page;
     $data['options'] = EvaluationOptionModel::get_options($search, '*', $limit);
     $data['search'] = $get;
     $this->load->view('interview/evaluation_option_index', $data);
 }