/** * @param array | string $select поля для выборки * должны быть возвращены lat, lng, html * @return array */ public function getOfficeList($select = null) { if (is_null($select)) { $select = ['point_lat as lat', 'point_lng as lng', 'concat("<h5>",point_address,"</h5>") as html']; } return Application::cache(self::PREFIX_CACHE_OFFICE_LIST . $this->getId(), function ($options) { $query = UnionOffice::query(['union_id' => $options['union_id']]); return $query->select($options['select'])->all(); }, ['select' => $select, 'union_id' => $this->getId()]); }
public function actionChenneling() { $itemsPerPage = $this->itemsPerPage; if (self::getParam('page', 1) == 1) { $cache = Application::cache(\app\models\Chenneling::MEMCACHE_KEY_LIST, function (PageController $controller) { $itemsPerPage = $controller->itemsPerPage; return $controller->renderFile('@app/views/page/chenneling_cache.php', $this->pageCluster(['query' => Chenneling::querylist()->orderBy(['date_insert' => SORT_DESC]), 'paginator' => ['size' => $itemsPerPage]])); }, $this, false); } else { $cache = $this->renderFile('@app/views/page/chenneling_cache.php', $this->pageCluster(['query' => Chenneling::querylist()->orderBy(['date_insert' => SORT_DESC]), 'paginator' => ['size' => $itemsPerPage]])); } return $this->render(['html' => $cache]); }