language; $userExplorerObjects = UserExplorerObjects::find()->where(['user_id' => $user->id]); $count = $userExplorerObjects->count(); $userExplorerObjects = $userExplorerObjects->orderBy(['date_visit' => SORT_DESC])->all(); $data = []; $totalPoints = 0; function countMessage($count) { $en = $count == 1 ? 'visited place' : 'visited places'; $bg = $count == 1 ? 'посетен обект' : 'посетени обекта'; return ['en' => $en, 'bg' => $bg]; } foreach ($userExplorerObjects as $ueo) { if ($ueo->explorerObject && $ueo->explorerObject->tourObject) { $tourObject = $ueo->explorerObject->tourObject; $totalPoints += $ueo->explorerObject->points; $data[] = (object)['name' => $lang == 'en' ? $tourObject->name_en : $tourObject->name, 'points' => $ueo->explorerObject->points, 'img' => $ueo->explorerObject->getSrcOfSingleImage('explorer_object_image', '1:1'), 'date' => $ueo->date_visit ? date('d.m.Y', strtotime($ueo->date_visit)) : '' ]; } } $count = sizeof($data) ?>
| :
name ?>
: points ?>
date ?>