示例#1
0
 protected function getListQuery()
 {
     $id = JRequest::getUInt('id');
     jimport('joomla.application.categories');
     $catObj = JCategories::getInstance('JNT_Hanhphuc', array('extension' => 'com_jnt_hanhphuc', 'table' => ''));
     $category = $catObj->get($id);
     $query = FrontJntHanhphucHelper::getUsers($category->id, true);
     return $query;
 }
示例#2
0
 public function getCategories()
 {
     jimport('joomla.application.categories');
     $catObj = JCategories::getInstance('JNT_Hanhphuc', array('extension' => 'com_jnt_hanhphuc', 'table' => ''));
     $categories = $catObj->get()->getChildren();
     // 		var_dump($categories);
     $arrCat = array();
     foreach ($categories as $key => $cat) {
         $sub = $cat->getChildren();
         foreach ($sub as &$c) {
             $users = FrontJntHanhphucHelper::getUsers($c->id);
             if (!empty($users)) {
                 $c->users = $users;
                 $arrCat[] = $c;
             }
         }
     }
     return $arrCat;
 }