Логика определения наличия пользователя дня
All checks were successful
Local Deploy with Docker / build-and-deploy (push) Successful in 34s

This commit is contained in:
Dmitrii Prokudin 2024-12-27 00:09:53 +03:00
parent 39f6705987
commit ffcffe940a

View File

@ -37,9 +37,9 @@ public interface IUserOfTheDayRepository
using (IDbConnection db = new NpgsqlConnection(_connectionString))
{
string query = "SELECT COUNT(1) FROM user_of_the_day WHERE chat_id = @ChatId AND date = @Date AND type = @Type";
var res = await db.ExecuteScalarAsync<bool>(query, new { ChatId = chatId, Date = date, Type = type });
var res = await db.ExecuteScalarAsync<int>(query, new { ChatId = chatId, Date = date, Type = type });
Console.WriteLine($"{chatId} : {type} : {res}");
return res;
return res > 0;
}
}