I need to display the maximum rate and minimum proposal rate along with count of proposals for each request that is posted by a logged in user using Statistical/ Relational Query. I am getting the count or minimum rate using the relation
public function relations()
{
return array('serviceproposals'=>
array(self::HAS_MANY,'Serviceproposal','ServiceRequestID'),
'user' => array(self::BELONGS_TO, 'Buyer', 'user_id'),
'postCount'=>array(self::STAT,'serviceproposal', 'ServiceRequestID','select'=>'MAX(proposal_rate)'),
);
}
Database used contains:-
User[user_id,name,password],
Provider[user_id,providercompany,providerdetails],
Buyer[user_id,contactinfo],
ServiceRequest[ServiceRequestID,Buyer.user_id,details,date],
ServiceProposal[ServiceProposalId,ServiceRequestID,Provider.user_id,services,propsal_rate]
Thanks in advance..
It is because of my mistake that I am not getting count, maximum and minimum rate. There needs to provide 2 separate relations so the 3 values are getting well.