From 3a2523b378669212d4f3155d313a4401474e2d59 Mon Sep 17 00:00:00 2001 From: David Davaham Date: Fri, 7 Sep 2018 05:51:09 -0400 Subject: [PATCH] Changing up the query for known mails to be limited to the currect character instead of the entire table. Have getting reports where people are not having mail attached to their account. I think this is the issue right here. --- app/Http/Controllers/DataController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/DataController.php b/app/Http/Controllers/DataController.php index a54c79e..7ca76df 100644 --- a/app/Http/Controllers/DataController.php +++ b/app/Http/Controllers/DataController.php @@ -1004,7 +1004,7 @@ public function getMemberMailHeaders($member, $pages=1) $headers = $headers->recursive(); $headers->chunk(25)->each(function($chunk) use(&$now, $member, &$recipients) { $mail_ids = $chunk->pluck('mail_id'); - $knownMails = MailHeader::whereIn('id', $mail_ids->toArray())->with('members')->get()->keyBy('id'); + $knownMails = $member->mails()->whereIn('id', $mail_ids->toArray())->get()->keyBy('id'); $attach = collect(); $chunk->each(function ($header) use ($knownMails, &$now, $member, $attach, &$recipients) { if (!$knownMails->has($header->get('mail_id'))) {