$row = $this->query("SELECT IF (`last_date` = DATE_ADD(CURRENT_DATE, INTERVAL - 1 DAY), 2, IF(`last_date` = CURRENT_DATE, 1, 2)) as 'result' FROM `db_bonus` WHERE `id` = '$id'");
switch ($row['result']) {
case 2:
// даю
break;
case 3:
// Обнуляю Дни
break;
case 1:
//
break;
}