PMCORE-1596 The files attached in the cases notes needs to send in the email notification.

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-06-11 11:49:54 -04:00
parent 3ddf8abc7c
commit 536c3588da
6 changed files with 204 additions and 16 deletions

View File

@@ -93,4 +93,20 @@ class Documents extends Model
return $documentList;
}
/**
* Get attached files from the case note.
* @param string $appUid
* @return object
*/
public static function getAttachedFilesFromTheCaseNote(string $appUid)
{
$result = Documents::select('APP_DOCUMENT.APP_DOC_UID', 'APP_DOCUMENT.DOC_VERSION', 'APP_DOCUMENT.APP_DOC_FILENAME')
->join('APP_NOTES', function($join) use($appUid) {
$join->on('APP_NOTES.NOTE_ID', '=', 'APP_DOCUMENT.DOC_ID')
->where('APP_DOCUMENT.APP_UID', '=', $appUid);
})
->get();
return $result;
}
}