| Línea 1685... |
Línea 1685... |
| 1685 |
|
1685 |
|
| 1686 |
$companies = [];
|
1686 |
$companies = [];
|
| 1687 |
$commentMapper = CommentMapper::getInstance($this->adapter);
|
1687 |
$commentMapper = CommentMapper::getInstance($this->adapter);
|
| Línea -... |
Línea 1688... |
| - |
|
1688 |
$records = $commentMapper->fetchAllPublishedByFeedId($feed->id);
|
| - |
|
1689 |
|
| - |
|
1690 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
| 1688 |
$records = $commentMapper->fetchAllPublishedByFeedId($feed->id);
|
1691 |
$owner = $companyUserMapper->fetchOwnerByCompanyId($feed->company_id);
|
| 1689 |
|
1692 |
|
| 1690 |
$comments = [];
|
1693 |
$comments = [];
|
| 1691 |
foreach ($records as $record) {
|
- |
|
| Línea 1692... |
Línea 1694... |
| 1692 |
$user = $userMapper->fetchOne($record->user_id);
|
1694 |
foreach ($records as $record) {
|
| 1693 |
// $company = $companyMapper->fetchOne($feed->company_id);
|
- |
|
| 1694 |
|
- |
|
| 1695 |
//if ($user->usertype_id == 3) {
|
- |
|
| 1696 |
$company = $companyMapper->fetchOne($feed->company_id);
|
- |
|
| 1697 |
if ($record->user_id == $currentUser->id) {
|
- |
|
| 1698 |
$link_delete = $this->url()->fromRoute('feed/comment/delete', ['id' => $feed->uuid, 'comment' => $record->uuid]);
|
- |
|
| 1699 |
} else {
|
- |
|
| 1700 |
$link_delete = '';
|
- |
|
| 1701 |
}
|
- |
|
| 1702 |
|
- |
|
| 1703 |
array_push($comments, [
|
- |
|
| 1704 |
'unique' => uniqid(),
|
- |
|
| 1705 |
'user_url' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
- |
|
| 1706 |
'user_name' => $user->first_name . ' ' . $user->last_name,
|
- |
|
| 1707 |
/* Aqui es Anderson */
|
- |
|
| 1708 |
'company' => $company->image,
|
- |
|
| 1709 |
'user_image' => $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image]),
|
- |
|
| 1710 |
'time_elapsed' => Functions::timeAgo($record->added_on, $now),
|
- |
|
| 1711 |
'comment' => $record->comment,
|
- |
|
| 1712 |
'link_delete' => $link_delete
|
1695 |
$user = $userMapper->fetchOne($record->user_id);
|
| 1713 |
]);
|
1696 |
|
| 1714 |
// } elseif ($user->usertype_id == 2) {
|
1697 |
// if ($user->usertype_id == 3) {
|
| 1715 |
// $company = $companyMapper->fetchOne($feed->company_id);
|
1698 |
// $company = $companyMapper->fetchOne($feed->company_id);
|
| 1716 |
// if ($record->user_id == $currentUser->id) {
|
1699 |
// if ($record->user_id == $currentUser->id) {
|
| Línea 1722... |
Línea 1705... |
| 1722 |
// array_push($comments, [
|
1705 |
// array_push($comments, [
|
| 1723 |
// 'unique' => uniqid(),
|
1706 |
// 'unique' => uniqid(),
|
| 1724 |
// 'user_url' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
1707 |
// 'user_url' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
| 1725 |
// 'user_name' => $user->first_name . ' ' . $user->last_name,
|
1708 |
// 'user_name' => $user->first_name . ' ' . $user->last_name,
|
| 1726 |
// /* Aqui es Anderson */
|
1709 |
// /* Aqui es Anderson */
|
| 1727 |
// //'company' => $company->image,
|
- |
|
| 1728 |
// 'user_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image]),
|
1710 |
// 'user_image' => $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image]),
|
| 1729 |
// 'time_elapsed' => Functions::timeAgo($record->added_on, $now),
|
1711 |
// 'time_elapsed' => Functions::timeAgo($record->added_on, $now),
|
| 1730 |
// 'comment' => $record->comment,
|
1712 |
// 'comment' => $record->comment,
|
| 1731 |
// 'link_delete' => $link_delete
|
1713 |
// 'link_delete' => $link_delete
|
| 1732 |
// ]);
|
1714 |
// ]);
|
| - |
|
1715 |
// } elseif ($user->usertype_id == 2) {
|
| - |
|
1716 |
$company = $companyMapper->fetchOne($feed->company_id);
|
| - |
|
1717 |
if ($record->user_id == $currentUser->id) {
|
| - |
|
1718 |
$link_delete = $this->url()->fromRoute('feed/comment/delete', ['id' => $feed->uuid, 'comment' => $record->uuid]);
|
| - |
|
1719 |
} else {
|
| - |
|
1720 |
$link_delete = '';
|
| - |
|
1721 |
}
|
| - |
|
1722 |
|
| - |
|
1723 |
array_push($comments, [
|
| - |
|
1724 |
'unique' => uniqid(),
|
| - |
|
1725 |
'user_url' => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
|
| - |
|
1726 |
'user_name' => $user->first_name . ' ' . $user->last_name,
|
| - |
|
1727 |
/* Aqui es Anderson */
|
| - |
|
1728 |
'company' => $owner,
|
| - |
|
1729 |
'user_image' => $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image]),
|
| - |
|
1730 |
'time_elapsed' => Functions::timeAgo($record->added_on, $now),
|
| - |
|
1731 |
'comment' => $record->comment,
|
| - |
|
1732 |
'link_delete' => $link_delete
|
| - |
|
1733 |
]);
|
| 1733 |
// }
|
1734 |
//}
|
| 1734 |
}
|
1735 |
}
|
| 1735 |
$item['comment_add_url'] = $this->url()->fromRoute('feed/comment', ['id' => $feed->uuid]);
|
1736 |
$item['comment_add_url'] = $this->url()->fromRoute('feed/comment', ['id' => $feed->uuid]);
|
| 1736 |
$item['comments'] = $comments;
|
1737 |
$item['comments'] = $comments;
|
| Línea 1737... |
Línea 1738... |
| 1737 |
|
1738 |
|