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


PHP Base_model::get_list方法代码示例

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


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

示例1: get_list

 /**
  * Returns enhanced media list
  *
  * @param null  $where
  * @param array $filters
  * @param bool  $addon_data
  *
  * @return array
  */
 public function get_list($where = NULL, $filters = array(), $addon_data = TRUE)
 {
     // Pages
     $this->{$this->db_group}->select("group_concat(url.path separator ';') as page_paths");
     $this->{$this->db_group}->join('page_media', 'page_media.id_media = ' . $this->table . '.id_media', 'left');
     $this->{$this->db_group}->join('url', "url.id_entity = page_media.id_page AND url.type='page' and url.active=1 and url.lang='" . Settings::get_lang('default') . "'", 'left');
     // Articles
     $this->{$this->db_group}->select("group_concat(url2.path separator ';') as article_paths");
     $this->{$this->db_group}->join('article_media', 'article_media.id_media = ' . $this->table . '.id_media', 'left');
     $this->{$this->db_group}->join('url as url2', "url2.id_entity = article_media.id_article AND url2.type='article' and url2.active=1 and url2.lang='" . Settings::get_lang('default') . "'", 'left');
     // Filters
     if (in_array('alt_missing', $filters)) {
         $this->{$this->db_group}->join('media_lang', 'media_lang.id_media = ' . $this->table . '.id_media', 'left');
         $this->{$this->db_group}->where("(media_lang.alt is null or media_lang.alt='')");
     }
     if (in_array('used', $filters)) {
         $this->{$this->db_group}->where('(url.path is not null or url2.path is not null)');
     }
     if (in_array('not_used', $filters)) {
         $this->{$this->db_group}->where('(url.path is null and url2.path is null)');
     }
     $this->{$this->db_group}->group_by($this->table . '.id_media');
     $this->{$this->db_group}->order_by($this->table . '.id_media', 'DESC');
     $result = parent::get_list($where, $this->table);
     if ($addon_data) {
         $result = $this->_add_lang_data_to_media_list($result);
     }
     return $result;
 }
开发者ID:trk,项目名称:ionize,代码行数:38,代码来源:medialist_model.php

示例2: get_list

 /**
  * @param null $parent
  * @param null $id_parent
  *
  * @return array|void
  *
  */
 public function get_list($parent = NULL, $id_parent = NULL)
 {
     // Get tags from one parent
     if (!is_null($parent) && $this->table_exists($parent . '_tag')) {
         $this->{$this->db_group}->join($parent . '_tag', $parent . '_tag.id_tag = ' . $this->get_table() . '.id_tag and ' . $parent . '_tag.id_' . $parent . ' = ' . $id_parent, 'inner');
     }
     return parent::get_list(array('order_by' => 'tag_name ASC'));
 }
开发者ID:pompalini,项目名称:emngo,代码行数:15,代码来源:tag_model.php

示例3: get_panel_elements

 public function get_panel_elements($id_company, $panel, $type = NULL)
 {
     $where = array('id_company' => $id_company, 'panel' => $panel, 'order_by' => 'ordering ASC');
     if (!is_null($type)) {
         $where['type'] = $type;
     }
     return parent::get_list($where);
 }
开发者ID:trk,项目名称:ionize,代码行数:8,代码来源:ui_model.php

示例4: get_list

 public function get_list($params, $page = 0, $count = 20)
 {
     $this->load->model('problem_model');
     $comments = parent::get_list($params, $page, $count);
     foreach ($comments as &$comment) {
         $comment['author'] = $this->user_model->get(array('id' => $comment['owner_id']))['nickname'];
         $comment['problem_title'] = $this->problem_model->get(array('id' => $comment['problem_id']))['title'];
     }
     return $comments;
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:10,代码来源:Problem_comment_model.php

示例5: get_list

 public function get_list($type, $page = 0, $count = 5)
 {
     $list = parent::get_list(array("s" => "", 'type' => $type), $page, $count);
     foreach ($list as $slide) {
         if (empty($slide['text'])) {
             break;
         }
         $slide['text'] = json_decode($slide['text']);
     }
     return $list;
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:11,代码来源:Slide_model.php

示例6: array

 /**
  * Get array of articles
  * 
  * For each article, set the article date.
  * The article date can be the creation date or the publish_on date if exists
  *
  * @access	public
  * @param 	array	An associative array
  * @return	array	Array of records
  *
  */
 function get_list($where = FALSE)
 {
     $data = array();
     $this->db->select($this->lang_table . '.*');
     $this->db->join($this->lang_table, $this->lang_table . '.id_' . $this->table . ' = ' . $this->table . '.id_' . $this->table, 'inner');
     $this->db->where($this->lang_table . '.lang', Settings::get_lang('default'));
     $data = parent::get_list($where);
     // Set the correct publish date
     foreach ($data as $key => $row) {
         $data[$key]['date'] = isDate($row['publish_on']) ? $row['publish_on'] : $row['created'];
     }
     return $data;
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:24,代码来源:article_model.php

示例7: get_list

 public function get_list($id, $page = 0, $count = 5, $isJson = false, $site = false)
 {
     $where = $id == "all" ? array() : array('id' => $id);
     $list = parent::get_list($where, $page, $count);
     foreach ($list as $key => $item) {
         if (!$isJson) {
             $list[$key]['tags'] = $this->tag_model->get_tag_list($item['tags']);
             $list[$key]['site'] = $this->get_site_by_json($item['site']);
             $list[$key]['steps'] = $this->get_step_by_json($item['steps']);
             // $list[$key]['chapters'] = $this->get_chapter_by_json($item['chapters']);
         } else {
             if ($site) {
                 $list[$key]['site'] = $this->get_site_by_json($item['site']);
             }
         }
     }
     return $list;
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:18,代码来源:Course_model.php

示例8: get_extend_media_list

 /**
  * Returns all medias linked to one extend field
  *
  * @param      $id_extend
  * @param      $parent
  * @param      $id_parent
  * @param null $lang
  *
  * @return array
  */
 public function get_extend_media_list($id_extend, $parent, $id_parent, $lang = NULL)
 {
     $data = array();
     self::$ci->load->model('extend_field_model', '', true);
     if (!$lang) {
         $lang = NULL;
     }
     $extend = self::$ci->extend_field_model->get_element_extend_field($id_extend, $parent, $id_parent, $lang);
     if (!empty($extend)) {
         $ids = strlen($extend['content']) > 0 ? explode(',', $extend['content']) : NULL;
         if (!empty($ids)) {
             $this->{$this->db_group}->select($this->get_table() . '.*', FALSE);
             $where = array('where_in' => array($this->get_table() . '.id_media' => $ids));
             // Separated from $where due to $escape set to FALSE
             $this->{$this->db_group}->order_by('field(' . $this->get_table() . '.id_media, ' . $extend['content'] . ')', '', FALSE);
             if (!is_null($lang)) {
                 $this->{$this->db_group}->select($this->get_lang_table() . '.*', FALSE);
                 $this->{$this->db_group}->join($this->get_lang_table(), $this->get_lang_table() . '.' . $this->get_pk_name() . '=' . $this->get_table() . '.' . $this->get_pk_name() . ' AND ' . $this->get_lang_table() . '.lang = \'' . $lang . '\'', 'left');
             }
             $data = parent::get_list($where, $this->get_table());
             $data = $this->_add_medias_infos($data);
         }
     }
     return $data;
 }
开发者ID:trk,项目名称:ionize,代码行数:35,代码来源:media_model.php

示例9: array

 function get_list($where = array())
 {
     $where['order_by'] = 'ordering ASC';
     return parent::get_list($where);
 }
开发者ID:nbourguig,项目名称:ionize,代码行数:5,代码来源:extend_field_model.php

示例10: get_fund_list

 public function get_fund_list($page)
 {
     $list = parent::get_list(array('type <=' => '1'), $page, 20);
     foreach ($list as &$item) {
         $item['ctime'] = date("H:i:s", strtotime($item['ctime']));
         $item['tags'] = $this->tag_model->get_list_by_json($item['tags']);
     }
     return $list;
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:9,代码来源:Problem_model.php

示例11: get_context_list

 public function get_context_list($context, $id_context = NULL, $parent = NULL, $id_parent = NULL, $id_extend_field_type = NULL)
 {
     $where = array('order_by' => 'ordering ASC');
     if (!empty($parent)) {
         $where['parent'] = $parent;
     }
     if (!empty($id_parent)) {
         $where['id_parent'] = $id_parent;
     }
     // Extend Lang : Label
     $this->{$this->db_group}->select($this->get_lang_table() . '.label');
     $this->{$this->db_group}->join($this->get_lang_table(), $this->get_lang_table() . '.' . $this->get_pk_name() . ' = ' . $this->get_table() . '.' . $this->get_pk_name() . ' AND ' . $this->get_lang_table() . '.lang = \'' . Settings::get_lang('default') . '\'', 'left');
     // Add Extend Type info
     $this->_join_to_extend_types($id_extend_field_type);
     // Context
     $this->{$this->db_group}->select(self::$_CONTEXT_TABLE . '.context,' . self::$_CONTEXT_TABLE . '.id_context');
     $this->_join_to_context($context, $id_context);
     // Extend Definition List
     $list = parent::get_list($where);
     return $list;
 }
开发者ID:pompalini,项目名称:ionize,代码行数:21,代码来源:extend_field_model.php

示例12: get_all_lang_list

 /**
  * Returns all articles with all lang data
  *
  * @param	array	$where
  * @return	array
  */
 public function get_all_lang_list($where = array())
 {
     $data = array();
     $this->{$this->db_group}->select($this->lang_table . '.*');
     $this->{$this->db_group}->join($this->lang_table, $this->lang_table . '.id_' . $this->table . ' = ' . $this->table . '.id_' . $this->table, 'inner');
     // URLs
     $this->{$this->db_group}->select('url.canonical, url.path, url.path_ids, url.full_path_ids');
     $this->{$this->db_group}->join($this->url_table . ' as url', $this->table . '.id_article = url.id_entity AND ' . '(' . 'url.active = 1 AND ' . "url.type = 'article' AND " . 'url.lang = ' . $this->lang_table . '.lang' . ')', 'left');
     $this->{$this->db_group}->select("\r\n\t\t\tgroup_concat(page.id_page separator ';') as page_ids,\r\n\t\t\tpage_lang.title as page_title\r\n\t\t");
     $this->{$this->db_group}->join('page_article', $this->table . '.id_article = page_article.id_article', 'left');
     $this->{$this->db_group}->join('page', 'page.id_page = page_article.id_page', 'left');
     $this->{$this->db_group}->join('page_lang', 'page_lang.id_page = page.id_page AND article_lang.lang = page_lang.lang', 'left');
     $this->{$this->db_group}->group_by($this->table . '.id_article');
     $this->{$this->db_group}->group_by($this->lang_table . '.lang');
     $articles = parent::get_list($where);
     foreach ($articles as $article) {
         if (empty($data[$article['id_article']][$article['lang']])) {
             if (!isset($data[$article['id_article']])) {
                 $data[$article['id_article']] = array();
             }
             if ($article['lang'] == Settings::get_lang('default')) {
                 $data[$article['id_article']]['data'] = $article;
             }
             $data[$article['id_article']][$article['lang']] = $article;
         }
     }
     return $data;
 }
开发者ID:trk,项目名称:ionize,代码行数:34,代码来源:article_model.php

示例13: _reorder

 private function _reorder($id_item_definition)
 {
     $cond = array('id_item_definition' => $id_item_definition, 'order_by' => 'ordering ASC, id_item DESC');
     $items = parent::get_list($cond);
     foreach ($items as $key => $item) {
         $this->{$this->db_group}->where($this->pk_name, $item['id_item'])->update($this->table, array('ordering' => $key + 1));
     }
 }
开发者ID:trk,项目名称:ionize,代码行数:8,代码来源:item_model.php

示例14: get_list_with_role

 /**
  * @param array $where
  *
  * @return array
  */
 public function get_list_with_role($where = array())
 {
     $this->_join_role();
     return parent::get_list($where);
 }
开发者ID:pompalini,项目名称:emngo,代码行数:10,代码来源:user_model.php

示例15: get_list

 public function get_list($params = array(), $page = 0, $count = 3)
 {
     return parent::get_list($params, $page, $count);
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:4,代码来源:Guide_model.php


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