// COUNT RATINGS ON USER ACCOUNT FROM SOME USER (to check if user already left rating)
public function countRatingsByUserId( $user_id, $user_email, $from_user_id ) {
$this->dao->select('count(*) as i_count');
$this->dao->from( $this->getTable_Rating() );
if($user_id == 0 || $user_id == '') {
$this->dao->where('s_user_email = "' . $user_email . '" AND fk_i_from_user_id = ' . $from_user_id );
} else {
$this->dao->where('fk_i_user_id = ' . $user_id . ' AND fk_i_from_user_id = ' . $from_user_id );
}
$result = $this->dao->get();
if( !$result ) { return array(); }
return $result->row();
}
I expect the code responsible for this
This function
but
What is the code to get the number of reviews?
Thanks