- Модуль: sender
- Путь к файлу: ~/bitrix/modules/sender/lib/entity/letter.php
- Класс: BitrixSenderEntityLetter
- Вызов: Letter::getLastPostingData
public function getLastPostingData()
{
$defaults = array();
if (!$this->getId())
{
return $defaults;
}
if ($this->postingData !== null)
{
return $this->postingData;
}
$this->postingData = $defaults;
$postingFilter = array(
'=ID' => $this->getId(),
//'!POSTING.DATE_SENT' => null
);
$postings = static::getList(array(
'select' => array(
'POSTING_ID',
'LETTER_ID' => 'ID',
'CAMPAIGN_ID',
'TITLE' => 'TITLE',
'MAILING_NAME' => 'CAMPAIGN.NAME',
'DATE_SENT' => 'POSTING.DATE_SENT',
'COUNT_SEND_ERROR' => 'POSTING.COUNT_SEND_ERROR',
'CREATED_BY' => 'CREATED_BY',
'CREATED_BY_NAME' => 'CREATED_BY_USER.NAME',
'CREATED_BY_LAST_NAME' => 'CREATED_BY_USER.LAST_NAME',
'CREATED_BY_SECOND_NAME' => 'CREATED_BY_USER.SECOND_NAME',
'CREATED_BY_LOGIN' => 'CREATED_BY_USER.LOGIN',
'CREATED_BY_TITLE' => 'CREATED_BY_USER.TITLE',
),
'filter' => $postingFilter,
'limit' => 1,
'order' => array('POSTING.DATE_SENT' => 'DESC', 'POSTING.DATE_CREATE' => 'DESC'),
));
if ($postingData = $postings->fetch())
{
$this->postingData = $postingData + $this->postingData;
}
return $this->postingData;
}