Retrieve contact records for the page visitor in Profile\Contacts module
This commit is contained in:
parent
36a8962333
commit
fca1abbafe
1 changed files with 10 additions and 2 deletions
|
@ -113,9 +113,17 @@ class Contacts extends Module\BaseProfile
|
|||
|
||||
$params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||
|
||||
// Contact list is obtained from the visited profile user, but the contact display is visitor dependent
|
||||
$contacts = array_map(
|
||||
[Module\Contact::class, 'getContactTemplateVars'],
|
||||
Model\Contact::selectToArray([], $condition, $params)
|
||||
function ($contact) {
|
||||
$contact = Model\Contact::selectFirst(
|
||||
[],
|
||||
['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
|
||||
['order' => ['uid' => 'DESC']]
|
||||
);
|
||||
return Module\Contact::getContactTemplateVars($contact);
|
||||
},
|
||||
Model\Contact::selectToArray(['uri-id'], $condition, $params)
|
||||
);
|
||||
|
||||
$desc = '';
|
||||
|
|
Loading…
Reference in a new issue