This commit is contained in:
antv
2026-07-16 16:01:15 +07:00
parent 939287d9b3
commit 9c20a25111
10 changed files with 123 additions and 180 deletions
@@ -20,4 +20,6 @@ interface UserServiceInterface
public function getRankingList(string $type, string $selectedMonth, User $currentUser): array;
public function updateProfile(User $user, array $data, ?\Illuminate\Http\UploadedFile $avatarFile = null): void;
public function getSentCardsToUserThisMonth(User $sender, string $receiverMsnv): int;
}
+11
View File
@@ -275,4 +275,15 @@ class UserService implements UserServiceInterface
$user->save();
}
public function getSentCardsToUserThisMonth(User $sender, string $receiverMsnv): int
{
$startOfMonth = Carbon::now()->startOfMonth();
$endOfMonth = Carbon::now()->endOfMonth();
return (int) Administration::where('msnv', $sender->msnv)
->where('receiver', $receiverMsnv)
->whereBetween('date', [$startOfMonth, $endOfMonth])
->sum('sent');
}
}