public function get_parent_categories()
{
$views = $this->wallpaperViews();
$this->db->select('wp.category_seq_id as wpcid,w.*');
$this->db->from('wallpapers_path wp');
$this->db->join('wallpapers w', 'w.wallpaper_seq_id = wp.wallpaper_seq_id');
$this->db->join("($views) as v", 'v.wv_wid = w.wallpaper_seq_id', 'left');
$this->db->group_by('wp.category_seq_id');
$this->db->order_by('total_views', 'desc');
echo $wallpaper_sql = $this->sql();
$this->db->select('w.*');
$this->wallCatTemplate(false);
$this->db->join("($wallpaper_sql) as w", 'w.wpcid = c.category_seq_id', 'left');
$this->db->where('w.wallpaper_seq_id IS NOT NULL');
$this->db->order_by('t2.category_name', 'asc');
echo $this->sql();
}