Back to PhocacartOrderView class

Method getItemUser

public
getItemUser
(mixed $orderId)

Method getItemUser - Source code

/*public function getRegion($countryId, $regionId) {

		$db = Factory::getDBO();
		$query = 'SELECT u.id, c.title AS countrytitle, r.title AS regiontitle'
				.' FROM #__phocacart_order_users AS u'
				.' LEFT JOIN #__phocacart_countries AS c ON c.id = u.country'
				.' LEFT JOIN #__phocacart_regions AS r ON r.id = u.region'
			    .' WHERE u.country = '.(int)$countryId. ' AND u.region = '.(int)$regionId;
		$db->setQuery($query);
		$region = $db->loadAssoc();
		return $region;
	}*/
public function getItemUser($orderId)
{
    $db = Factory::getDBO();
    $query = 'SELECT u.*,' . ' c.title AS countrytitle, r.title AS regiontitle, c.code2 AS countrycode' . ' FROM #__phocacart_order_users AS u' . ' LEFT JOIN #__phocacart_countries AS c ON c.id = u.country' . ' LEFT JOIN #__phocacart_regions AS r ON r.id = u.region' . ' WHERE u.order_id = ' . (int) $orderId . ' AND (u.type = 1 OR u.type = 0)' . ' ORDER BY u.id' . ' LIMIT 0,2';
    $db->setQuery($query);
    $userList = $db->loadAssocList();
    return $userList;
}