Beispiel #1
0
 public function actionPraktice_item($year, $month, $day, $id)
 {
     $date = $year . $month . $day;
     $newsItem = Praktice::find(['date' => $date, 'id_string' => $id]);
     if (is_null($newsItem)) {
         throw new Exception('Нет такой прктики');
     }
     $newsItem->incViewCounter();
     $row = $newsItem->getFields();
     return $this->render(['item' => $newsItem->getFields(), 'lastList' => Praktice::queryList()->where(['not in', 'id', $row['id']])->orderBy(['date_insert' => SORT_DESC])->limit(3)->all()]);
 }