public function getCount($data) {
$params = [
'user_id' => $data->user_id,
'period' => $data->period,
];
return $this->db->row('SELECT COUNT(*) FROM enrollments WHERE user_id = :user_id && status = 1 && UNIX_TIMESTAMP(date) > :period', $params);
}