当前位置: 首页>>代码示例>>PHP>>正文


PHP article::where_related_newscatalogue方法代码示例

本文整理汇总了PHP中article::where_related_newscatalogue方法的典型用法代码示例。如果您正苦于以下问题:PHP article::where_related_newscatalogue方法的具体用法?PHP article::where_related_newscatalogue怎么用?PHP article::where_related_newscatalogue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在article的用法示例。


在下文中一共展示了article::where_related_newscatalogue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dosearch

 /**
  * Cnews::dosearch()
  * 
  * @param string $st
  * @param integer $offset
  * @param integer $limit
  * @return
  */
 function dosearch($st = "", $offset = 0, $limit = 5)
 {
     $this->load->helper('text');
     $separate = "aaaaaaa23423dddeeeeee838234eeeeefffffff99923ffffffsdfsdfsdfsdf";
     $sep = "239847293dlkfaslf::sdflksdf::sdkfjsldf";
     $this->load->helper('remove_vn');
     $logged_role = $this->logged_in_user->adminrole->id;
     if ($_SERVER['REQUEST_METHOD'] == "GET") {
         $key_list = explode($sep, $st);
         $news = new article();
         if ($key_list[0] != $separate) {
             $news->like('title_vietnamese', $key_list[0]);
         }
         if ($key_list[1] != $separate) {
             $news->where('newscatalogue_id', $key_list[1]);
         } else {
             $news->where_related_newscatalogue('parentcat_id', 7);
         }
         if ($key_list[2] != $separate) {
             $news->where('created >', $key_list[2]);
             $news->where('created <', $key_list[3]);
         }
         if ($key_list[4] != 3) {
             $news->where('active', $key_list[4]);
         }
         if ($key_list[5] != 3) {
             $news->where('hot', $key_list[5]);
         }
         if ($key_list[6] != 3) {
             $news->where('home_hot', $key_list[6]);
         }
         $news->where('recycle', $key_list[7]);
         //arrange by
         switch ($key_list[8]) {
             case "thoigian":
                 $news->order_by('id', $key_list[9]);
                 break;
             case "docnhieu":
                 $news->order_by('view_count', $key_list[9]);
                 break;
         }
         $news->get_paged($offset, $key_list[10], TRUE);
         //       $this->firephp->log($news->check_last_query());
         setPagination($this->admin . 'cnews/dosearch/' . $st, $news->paged->total_rows, $key_list[10], 5);
         $dis['base_url'] = base_url();
         $dis['view'] = 'news/search';
         $dis['news'] = $news;
         $dis['search_result'] = 1;
         $dis['menu_active'] = "Tìm kiếm";
         $dis['title_table'] = "Trang hiện tại:" . $news->paged->current_page . '/' . $news->paged->total_pages;
         $dis['title'] = "Kết quả tìm kiếm";
         $dis['searchkey'] = $key_list[0] != $separate ? $key_list[0] : "";
         $dis['catalogue_id'] = $key_list[1];
         $dis['date_start'] = $key_list[2] != $separate ? $key_list[2] : "";
         $dis['date_end'] = $key_list[3] != $separate ? $key_list[3] : "";
         $dis['active'] = $key_list[4];
         $dis['hot_cat'] = $key_list[5];
         $dis['hot_home'] = $key_list[6];
         $dis['recycle'] = $key_list[7];
         $dis['arrange_by'] = $key_list[8];
         $dis['arrange_direct'] = $key_list[9];
         $dis['showperpage'] = $key_list[10];
         $newscatalogue = new Newscatalogue();
         $newscatalogue->where('parentcat_id', 7);
         $newscatalogue->order_by('position', 'asc');
         $newscatalogue->get();
         $dis['newscatalogue'] = $newscatalogue;
         $this->viewadmin($dis);
     } else {
         $searchkey = trim($this->input->post('searchkey'));
         $catalogue_id = $this->input->post('newscatalogue');
         $date_start = $this->input->post('date_start');
         $date_end = $this->input->post('date_end');
         $active = $this->input->post('active');
         $hot_cat = $this->input->post('hot_cat');
         $hot_home = $this->input->post('hot_home');
         $arrange_by = $this->input->post('arrange_by');
         $arrange_direct = $this->input->post('arrange_direct');
         $showperpage = $this->input->post('showperpage');
         $recycle = $this->input->post('recycle') == 1 ? $this->input->post('recycle') : 0;
         //create string uri query
         $search_string = "";
         $search_string .= $searchkey == "" ? $separate : $searchkey;
         $search_string .= $sep . ($catalogue_id ? $catalogue_id : $separate);
         $search_string .= $sep . ($date_start != "" ? $date_start : $separate);
         $search_string .= $sep . ($date_end != "" ? $date_end : $separate);
         $search_string .= $sep . $active;
         $search_string .= $sep . $hot_cat;
         $search_string .= $sep . $hot_home;
         $search_string .= $sep . $recycle;
         $search_string .= $sep . $arrange_by;
         $search_string .= $sep . $arrange_direct;
//.........这里部分代码省略.........
开发者ID:lxthien,项目名称:batdongsan,代码行数:101,代码来源:cnews.php


注:本文中的article::where_related_newscatalogue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。