Merge branch 'master' into Development
This commit is contained in:
@@ -72,7 +72,15 @@ public function share(Request $request): array
|
||||
$activities = \App\Models\Activity::query()
|
||||
->select(['id', 'due_date', 'amount', 'contract_id', 'client_case_id', 'created_at'])
|
||||
->whereDate('due_date', $today)
|
||||
// Removed per-user unread filter: show notifications regardless of individual reads
|
||||
// Exclude activities that have been marked as read by this user
|
||||
->whereNotExists(function ($q) use ($user, $today) {
|
||||
$q->select(\DB::raw(1))
|
||||
->from('activity_notification_reads')
|
||||
->whereColumn('activity_notification_reads.activity_id', 'activities.id')
|
||||
->where('activity_notification_reads.user_id', $user->id)
|
||||
->whereDate('activity_notification_reads.due_date', '<=', $today)
|
||||
->whereNotNull('activity_notification_reads.read_at');
|
||||
})
|
||||
->orderBy('created_at')
|
||||
->limit(20)
|
||||
->get();
|
||||
|
||||
Reference in New Issue
Block a user