back fix
Some checks failed
Backend CI / test (push) Has been cancelled
Deploy Mnemo Cards / Deploy Backend (push) Has been cancelled
Backend CI / build (push) Has been cancelled
Deploy Mnemo Cards / Deploy Web App (push) Has been cancelled
Deploy Mnemo Cards / Final Verification (push) Has been cancelled
Some checks failed
Backend CI / test (push) Has been cancelled
Deploy Mnemo Cards / Deploy Backend (push) Has been cancelled
Backend CI / build (push) Has been cancelled
Deploy Mnemo Cards / Deploy Web App (push) Has been cancelled
Deploy Mnemo Cards / Final Verification (push) Has been cancelled
This commit is contained in:
parent
a36af9d4bd
commit
39eeda7fa7
3 changed files with 21 additions and 9 deletions
|
|
@ -22,8 +22,13 @@ class PackDao extends DatabaseAccessor<AppDatabase> with _$PackDaoMixin {
|
|||
// ==================== CardPacks ====================
|
||||
|
||||
/// Получить пак по ID
|
||||
Future<CardPack?> getPackById(String id) {
|
||||
return (select(cardPacks)..where((p) => p.id.equals(id))).getSingleOrNull();
|
||||
Future<CardPack?> getPackById(String id) async {
|
||||
final query = select(cardPacks)
|
||||
..where((p) => p.id.equals(id))
|
||||
..limit(1);
|
||||
|
||||
final results = await query.get();
|
||||
return results.isNotEmpty ? results.first : null;
|
||||
}
|
||||
|
||||
/// Получить все паки
|
||||
|
|
|
|||
|
|
@ -98,9 +98,13 @@ class PaymentDao extends DatabaseAccessor<AppDatabase>
|
|||
}
|
||||
|
||||
/// Получить платеж по externalToken (только активные)
|
||||
Future<Payment?> getPaymentByExternalToken(String token) {
|
||||
return (selectActive()..where((p) => p.externalToken.equals(token)))
|
||||
.getSingleOrNull();
|
||||
Future<Payment?> getPaymentByExternalToken(String token) async {
|
||||
final query = selectActive()
|
||||
..where((p) => p.externalToken.equals(token))
|
||||
..limit(1);
|
||||
|
||||
final results = await query.get();
|
||||
return results.isNotEmpty ? results.first : null;
|
||||
}
|
||||
|
||||
/// Получить платежи по продукту (store ID) (только активные)
|
||||
|
|
|
|||
|
|
@ -139,10 +139,13 @@ class UserDao extends DatabaseAccessor<AppDatabase> with _$UserDaoMixin {
|
|||
// ==================== UserData ====================
|
||||
|
||||
/// Получить UserData пользователя
|
||||
Future<UserData?> getUserData(String userId) {
|
||||
return (select(
|
||||
userDatas,
|
||||
)..where((ud) => ud.userId.equals(userId))).getSingleOrNull();
|
||||
Future<UserData?> getUserData(String userId) async {
|
||||
final query = select(userDatas)
|
||||
..where((ud) => ud.userId.equals(userId))
|
||||
..limit(1);
|
||||
|
||||
final results = await query.get();
|
||||
return results.isNotEmpty ? results.first : null;
|
||||
}
|
||||
|
||||
/// Создать UserData
|
||||
|
|
|
|||
Loading…
Reference in a new issue