Skip to content

Commit

Permalink
Changing up the query for known mails to be limited to the currect ch…
Browse files Browse the repository at this point in the history
…aracter 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.
  • Loading branch information
ddavaham committed Sep 7, 2018
1 parent 850df08 commit 3a2523b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/DataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand Down

0 comments on commit 3a2523b

Please sign in to comment.