RSS
Home
Welcome, Guest
Please Login or Register.    Lost Password?

counting agent product in agentlisting
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: counting agent product in agentlisting
#9029
counting agent product in agentlisting 2 Years, 1 Month ago Karma: 5
I tried this but does not work. Syntax error

In models/agents.php

Code:


function _buildQuery()
{
if(JRequest::getVar('ShowOrderBy')){
$ShowOrderByDefault = JRequest::getVar('ShowOrderBy');}
switch ($ShowOrderByDefault)
{
case 1: $o='u.name';
break;
case 2: $o='u.company_location';
break;
default: $o='cantidad';
break;
}
$this->sqlShowOrderBy = ' ORDER BY '.$o;
if(JRequest::getVar('order')){ $this->sqlOrder=JRequest::getVar('order');}else{$this->sqlOrder='asc';}

$this->_query = 'SELECT * FROM #__properties_profiles AS u, COUNT(p.id) AS cantidad '
.' LEFT JOIN #__properties_products AS p ON (u.mid = p.agent_id)  '
.' WHERE u.show = 1 '
.' GROUP BY u.mid '
. $this->sqlShowOrderBy .' '.$this->sqlOrder
;
return $this->_query;
}


TuteMdz
Gold Boarder
Posts: 170
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/03/26 17:52 By TuteMdz.Reason: +++
The administrator has disabled public write access.
 
Go to topPage: 1