This commit is contained in:
antv
2026-07-15 22:05:39 +07:00
parent 866d46bf21
commit d16db9c73d
6 changed files with 474 additions and 7 deletions
+29 -3
View File
@@ -193,10 +193,10 @@ class UserService implements UserServiceInterface
$currentUserRankItem = $userItem;
}
if ($index < 4) {
$rankers[] = $userItem;
}
// Include every ranked user (no hard limit)
$rankers[] = $userItem;
$rank++;
}
if (!$currentUserRankItem) {
@@ -214,6 +214,32 @@ class UserService implements UserServiceInterface
];
}
// Retrieve paginated list of received ThankCards for a user
public function getReceivedPageData(User $user, string $selectedMonth): array
{
$start = Carbon::parse($selectedMonth)->startOfMonth();
$end = Carbon::parse($selectedMonth)->endOfMonth();
$cards = Administration::where('msnv', $user->msnv)
->whereBetween('date', [$start, $end])
->where('received', '>', 0)
->orderBy('date', 'desc')
->get();
return ['cards' => $cards];
}
// Retrieve paginated list of sent ThankCards for a user
public function getSentPageData(User $user, string $selectedMonth): array
{
$start = Carbon::parse($selectedMonth)->startOfMonth();
$end = Carbon::parse($selectedMonth)->endOfMonth();
$cards = Administration::where('msnv', $user->msnv)
->whereBetween('date', [$start, $end])
->where('sent', '>', 0)
->orderBy('date', 'desc')
->get();
return ['cards' => $cards];
}
public function updateProfile(User $user, array $data, ?\Illuminate\Http\UploadedFile $avatarFile = null): void
{
if (isset($data['name'])) {