Skip to content

Commit bedb1ca

Browse files
committed
Bugfix
1 parent a4959c0 commit bedb1ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Http/Controllers/AdminController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public function users(Request $request)
9999
// Rest of your code to calculate click counts and link counts for each user
100100

101101
foreach ($users as $user) {
102-
$user->clicks = $clicksCounts[$user->id]->total_clicks ?? 0;
103-
$user->links = $linksCounts[$user->id]->total_links ?? 0;
102+
$user->clicks = Link::where('user_id', $user->id)->sum('click_number');
103+
$user->links = Link::where('user_id', $user->id)->select('link')->count();
104104
}
105105

106106
$data['users'] = $users;

0 commit comments

Comments
 (0)