public static function content_type() { try { $db = JFactory::getDBO(); $query = ' select * from ( SELECT * FROM #__gg_contenuti_tipology where pubblicato = 1 UNION ALL SELECT * FROM #__gg_unit_tipology ) as tutti ORDER BY ordinamento '; FB::log($query, "query typology"); $db->setQuery($query); if (false === ($results = $db->loadObjectList())) { throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR); } FB::log($results, 'contenttype'); return $results; } catch (Exception $e) { FB::exception($e); } }
public function searchCountAttributes4filters($idList) { try { //RS count livello $queryLivello = ' select livello,count(*)as count FROM `vxvos_gg_contenuti` as c where id in ('.$idList.') group by livello'; FB::log($queryLivello, "query livello searchCountAttributes4filters "); $this->_db->setQuery($queryLivello); if (false === ($counterslistlivello = $this->_db->loadAssocList())) throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR); // FB::log($contents); FB::log($counterslistlivello, " counterslistlivello"); $counterslist[livello]=$counterslistlivello; //RS count Area $queryArea = 'select area,count(*)as count FROM `vxvos_gg_contenuti` as c where id in ('.$idList.') group by area'; FB::log($queryArea, "query area searchCountAttributes4filters "); $this->_db->setQuery($queryArea); if (false === ($counterslistarea = $this->_db->loadAssocList())) throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR); // FB::log($contents); FB::log($counterslistarea, " counterslistarea"); $counterslist[area]=$counterslistarea; //RS count formato $queryFormato = ' SELECT form.formato,count(*) as count FROM `vxvos_gg_contenuti` as c JOIN vxvos_gg_formati_contenuti_map as formmap on c.id = formmap.idcontenuto JOIN vxvos_gg_formati as form on form.id= formmap.idformato where c.id in ('.$idList.') group by form.formato'; FB::log($queryFormato, "query formato searchCountAttributes4filters "); $this->_db->setQuery($queryFormato); if (false === ($counterslistformato = $this->_db->loadAssocList())) throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR); // FB::log($contents); FB::log($counterslistformato, " counterslistformato"); $counterslist[formato]=$counterslistformato; //RS count prodotto $queryProdotto = ' SELECT prod.prodotto,count(*) as count FROM `vxvos_gg_contenuti` as c JOIN vxvos_gg_prodotti_contenuti_map as prodmap on c.id = prodmap.idcontenuto JOIN vxvos_gg_prodotti as prod on prod.id= prodmap.idprodotto where c.id in ('.$idList.') group by prod.prodotto'; FB::log($queryProdotto, "query prodotto searchCountAttributes4filters "); $this->_db->setQuery($queryProdotto); if (false === ($counterslistprodotto = $this->_db->loadAssocList())) throw new RuntimeException($this->_db->getErrorMsg(), E_USER_ERROR); // FB::log($contents); FB::log($counterslistprodotto, " counterslistprodotto"); $counterslist[prodotto]=$counterslistprodotto; FB::log($counterslist, " counterslist totale"); return $counterslist; } catch (Exception $e) { FB::exception($e); } }