コード例 #1
0
ファイル: category.php プロジェクト: ngxuanmui/hp3
 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
ファイル: categories.php プロジェクト: ngxuanmui/hanhphuc.vn
 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;
 }