Osclass Support Forums
Osclass plugin support => User Rating Plugin => Topic started by: 7ala on September 02, 2021, 08:44:45 AM
-
welcome
Thank you for your great support
Is there a way to show the number of user ratings
or the number of item ratings
Total number per user or per item
In the user control panel
thank you
-
@7ala
I would recomment to check model of plugin for custom functions.
-
// 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