Display number of welcome notification on listings page

[MAILPOET-1562]
This commit is contained in:
Pavel Dohnal
2018-11-12 15:32:02 +01:00
parent 6c8705f3c2
commit 362235e96a
4 changed files with 35 additions and 6 deletions

View File

@ -514,6 +514,13 @@ class Newsletter extends Model {
return $this;
}
function withScheduledToBeSent() {
$this->total_scheduled = (int)SendingQueue::findTaskByNewsletterId($this->id)
->where('tasks.status', SendingQueue::STATUS_SCHEDULED)
->count();
return $this;
}
function withStatistics() {
$statistics = $this->getStatistics();
$this->statistics = $statistics;