Performance fix for address_merge, when there are a log of echomails to move to the new address
This commit is contained in:
parent
c8ef7d065b
commit
2765a27db8
@ -346,7 +346,11 @@ class SystemController extends Controller
|
||||
->join('echomail_seenby',['echomail_seenby.echomail_id'=>'echomails.id'])
|
||||
->whereIn('address_id',[$request->src])
|
||||
->distinct()
|
||||
->with(['seenby:id'])
|
||||
->with(['seenby'=>function($query) use ($request) {
|
||||
return $query
|
||||
->select('id')
|
||||
->whereIn('address_id',[$request->src,$request->dst]);
|
||||
}])
|
||||
->get()
|
||||
->filter(function($item) use ($request) {
|
||||
return $item->seenby->contains($request->dst) && $item->seenby->contains($request->src);
|
||||
|
Loading…
Reference in New Issue
Block a user