Exemplo n.º 1
0
 function pager()
 {
     // 设置必须的参数
     $where = array();
     $where['category'] = $this->category;
     $where['related_id'] = $this->related_id;
     //列表
     $return = parent::pager($where);
     // 内容链接
     $base_url = $this->pager_url;
     if ($this->input->get("page")) {
         $base_url .= "&page=" . $this->input->get("page");
     }
     foreach ($return['list_result'] as $key => $temp) {
         $return['list_result'][$key]['booth_url'] = $base_url . "&bid=" . $temp['id'];
     }
     // 当前内容信息
     $current_booth_id = $this->input->get('bid');
     if ($current_booth_id) {
         foreach ($return['list_result'] as $key => $temp) {
             if ($temp['id'] == $current_booth_id) {
                 $current_booth = $temp;
                 break;
             }
         }
         if (!isset($current_booth)) {
             show_404();
         }
     } else {
         $current_booth = @$return['list_result'][0];
     }
     $return['current_booth'] = $current_booth;
     return $return;
 }
Exemplo n.º 2
0
 function pager()
 {
     // 设置必须的参数
     $where = array();
     $p_id = $this->input->get('id');
     $p_cid = $this->input->get('cid');
     $p_pid = $this->input->get('pid');
     $where = array('company_id' => $p_id, 'category_id' => $p_cid);
     //列表
     $return = parent::pager($where);
     // 内容链接
     $base_url = $this->pager_url;
     if ($this->input->get("page")) {
         $base_url .= "&page=" . $this->input->get("page");
     }
     foreach ($return['list_result'] as $key => $temp) {
         $return['list_result'][$key]['product_url'] = $base_url;
     }
     // 当前内容信息
     $current_product_id = $this->input->get('bid');
     if ($current_product_id) {
         foreach ($return['list_result'] as $key => $temp) {
             if ($temp['id'] == $current_product_id) {
                 $current_product = $temp;
                 break;
             }
         }
         if (!isset($current_product)) {
             show_404();
         }
     } else {
         $current_product = @$return['list_result'][0];
     }
     $return['current_product'] = $current_product;
     return $return;
 }