本文整理汇总了PHP中Base_module_model::_common_query方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_module_model::_common_query方法的具体用法?PHP Base_module_model::_common_query怎么用?PHP Base_module_model::_common_query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_module_model
的用法示例。
在下文中一共展示了Base_module_model::_common_query方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function _common_query()
{
parent::_common_query();
$this->db->select($this->_tables['navigation'].'.*, '.$this->_tables['navigation_groups'].'.id group_id, '.$this->_tables['navigation_groups'].'.name group_name');
$this->db->join($this->_tables['navigation_groups'], $this->_tables['navigation_groups'].'.id='.$this->_tables['navigation'].'.group_id', 'left');
$this->db->order_by('precedence, location asc');
}
示例2: _common_query
public function _common_query()
{
parent::_common_query();
$this->db->order_by('publish_date', 'desc');
}
示例3: _common_query
/**
* Overwrites the _common_query parent method to automatically sort by precedence value
*
* @access public
* @param mixed parameter to pass to common query (optional)
* @return array
*/
public function _common_query($params = NULL)
{
parent::_common_query();
$this->db->order_by('precedence asc');
}
示例4: _common_query
public function _common_query($display_unpublished_if_logged_in = NULL)
{
parent::_common_query($display_unpublished_if_logged_in);
$this->db->select($this->_tables['form_entries'] . '.*, ' . $this->_tables['forms'] . '.name as form');
$this->db->join($this->_tables['forms'], $this->_tables['forms'] . '.name = ' . $this->_tables['form_entries'] . '.form_name', 'LEFT');
// remove if no precedence column is provided
$this->db->order_by('date_added desc');
}
示例5:
function _common_query()
{
parent::_common_query();
$this->db->order_by('start_date asc');
}
示例6: _common_query
public function _common_query($display_unpublished_if_logged_in = NULL)
{
parent::_common_query($display_unpublished_if_logged_in);
$rel_join = $this->_tables['fuel_relationships'] . '.candidate_key = ' . $this->table_name . '.id AND ';
$rel_join .= $this->_tables['fuel_relationships'] . '.candidate_table = "' . $this->table_name . '" AND ';
$rel_join .= $this->_tables['fuel_relationships'] . '.foreign_table = "' . $this->_tables['fuel_tags'] . '"';
$this->db->join($this->_tables['fuel_relationships'], $rel_join, 'left');
$this->db->join($this->_tables['fuel_tags'], $this->_tables['fuel_tags'] . '.id = ' . $this->_tables['fuel_relationships'] . '.foreign_key', 'left');
$this->db->select($this->table_name . '.*');
$this->db->select('YEAR(' . $this->table_name . '.' . $this->order_by_field . ') as year, DATE_FORMAT(' . $this->table_name . '.' . $this->order_by_field . ', "%m") as month, DATE_FORMAT(' . $this->table_name . '.' . $this->order_by_field . ', "%d") as day,', FALSE);
$this->db->order_by($this->order_by_field . ' ' . $this->order_by_direction);
$this->db->group_by($this->table_name . '.id');
if (!empty($this->foreign_keys['category_id'])) {
$this->db->join('fuel_categories', 'fuel_categories.id = ' . $this->table_name . '.category_id', 'LEFT');
$this->db->select($this->table_name . '.*, fuel_categories.slug as category_slug, fuel_categories.id as category_id', FALSE);
}
}
示例7: _common_query
/**
* Common query to automatically join the categories table
*
* @access public
* @param mixed parameter to pass to common query (optional)
* @return void
*/
public function _common_query($params = NULL)
{
parent::_common_query();
$this->db->join($this->_tables['fuel_categories'], $this->_tables['fuel_categories'] . '.id = ' . $this->_tables['fuel_tags'] . '.category_id', 'LEFT');
}
示例8:
function _common_query()
{
parent::_common_query();
}
示例9: _common_query
public function _common_query($display_unpublished_if_logged_in = NULL)
{
parent::_common_query($display_unpublished_if_logged_in);
$this->db->order_by('publish_date', 'desc');
}
示例10: CONCAT
function _common_query()
{
parent::_common_query();
$this->db->select($this->_tables['blog_posts'] . '.*, ' . $this->_tables['blog_users'] . '.display_name, CONCAT(' . $this->_tables['fuel_users'] . '.first_name, " ", ' . $this->_tables['fuel_users'] . '.last_name) as author_name', FALSE);
$this->db->select('YEAR(' . $this->_tables['blog_posts'] . '.post_date) as year, DATE_FORMAT(' . $this->_tables['blog_posts'] . '.post_date, "%m") as month, DATE_FORMAT(' . $this->_tables['blog_posts'] . '.post_date, "%d") as day,', FALSE);
$rel_join = $this->_tables['blog_relationships'] . '.candidate_key = ' . $this->_tables['blog_posts'] . '.id AND ';
$rel_join .= $this->_tables['blog_relationships'] . '.candidate_table = "' . $this->_tables['blog_posts'] . '" AND ';
$rel_join .= $this->_tables['blog_relationships'] . '.foreign_table = "' . $this->_tables['blog_categories'] . '"';
$this->db->join($this->_tables['blog_relationships'], $rel_join, 'left');
$this->db->join($this->_tables['blog_users'], $this->_tables['blog_users'] . '.fuel_user_id = ' . $this->_tables['blog_posts'] . '.author_id', 'left');
$this->db->join($this->_tables['fuel_users'], $this->_tables['fuel_users'] . '.id = ' . $this->_tables['blog_posts'] . '.author_id', 'left');
$this->db->join($this->_tables['blog_categories'], $this->_tables['blog_categories'] . '.id = ' . $this->_tables['blog_relationships'] . '.foreign_key', 'left');
$this->db->group_by($this->_tables['blog_posts'] . '.id');
}
示例11: _common_query
public function _common_query($display_unpublished_if_logged_in = NULL)
{
parent::_common_query($display_unpublished_if_logged_in);
}