コード例 #1
0
ファイル: Union.php プロジェクト: Makeyko/galaxysss
 /**
  * @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()]);
 }
コード例 #2
0
 public function actionIndex($unionId)
 {
     return $this->render(['items' => \app\models\UnionOffice::query(['union_id' => $unionId])->all(), 'union_id' => $unionId]);
 }