Created
July 9, 2013 14:27
-
-
Save e06widu/5957760 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // No direct access to this file | |
| defined('_JEXEC') or die('Restricted access'); | |
| // import the Joomla modellist library | |
| jimport('joomla.application.component.modellist'); | |
| /** | |
| * HelloWorldList Model | |
| */ | |
| class MyResourceListModelRegions extends JModelList | |
| { | |
| /** | |
| * Method to build an SQL query to load the list data. | |
| * | |
| * @return string An SQL query | |
| */ | |
| protected function getListQuery() | |
| { | |
| // Create a new query object. | |
| $db = JFactory::getDBO(); | |
| $query = $db->getQuery(true); | |
| // Select some fields | |
| $query->select('reg.id as id,reg.Name as Name,reg.userId as userId,user.name as username'); | |
| // From the hello table | |
| $query->from('#__region as reg'); | |
| $query->leftJoin("#__users as user on user.id= reg.userId"); | |
| return $query; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment