public function CalculateStatistics($param) { $point = 0; $rating = 0; $people = 0; // Get Rating $ratings = parent::GetRating($param); if (!empty($ratings) && $ratings > 0) { $rating = $ratings; } else { $rating = 0; } // Get point $points = parent::GetPoint($param); if (!empty($points) && $points > 0) { $point = $points; } else { $point = 0; } // Get People $peoples = parent::CountPeopleProcess($param); if (!empty($peoples) && $peoples > 0) { $people = $peoples; } else { $people = 0; } // Stat updating to place profile parent::UpdateStat(array('place_id' => $param['place_id'], 'point' => $point + $rating, 'rating' => $rating, 'people' => $people)); }