mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
610bc9f4bc
commit
5e7ee8c5bf
@ -27,6 +27,7 @@ namespace FireflyIII\Helpers\Collector\Extensions;
|
|||||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||||
use FireflyIII\Models\Attachment;
|
use FireflyIII\Models\Attachment;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
@ -299,7 +300,19 @@ trait AttachmentCollection
|
|||||||
{
|
{
|
||||||
Log::debug('Add filter on no attachments.');
|
Log::debug('Add filter on no attachments.');
|
||||||
$this->joinAttachmentTables();
|
$this->joinAttachmentTables();
|
||||||
$this->query->whereNull('attachments.attachable_id');
|
|
||||||
|
$this->query->where(function (Builder $q1) {
|
||||||
|
$q1
|
||||||
|
->whereNull('attachments.attachable_id')
|
||||||
|
->orWhere(function (Builder $q2) {
|
||||||
|
$q2
|
||||||
|
->whereNotNull('attachments.attachable_id')
|
||||||
|
->whereNotNull('attachments.deleted_at');
|
||||||
|
// id is not null
|
||||||
|
// deleted at is not null.
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user