Esempio n. 1
0
 /**
  * @param $id
  * @return string
  * @throws NotFoundHttpException
  */
 public function actionDetail($id)
 {
     \Yii::$app->getView()->params['leftMenu']['active'] = "project_{$id}";
     $model = $this->findModel($id);
     $query = ListProfiler::find()->where(['project_id' => $id]);
     $data = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => self::PAGE_SIZE], 'sort' => false]);
     return $this->render('detail.tpl', ['model' => $model, 'data' => $data, 'total' => $query->count()]);
 }
Esempio n. 2
0
 public function actionDetail($id)
 {
     $profiler = $this->findProfiler($id);
     LastActiveDate::getModel(LastActiveDate::TYPE_PROFILER)->setData((int) $id)->setUserId(\Yii::$app->user->id)->save();
     $project = Project::findOne($profiler->project_id);
     if (!$project) {
         throw new NotFoundHttpException('Проект профайлера не найден');
     }
     \Yii::$app->getView()->params['leftMenu']['active'] = "profiler_{$profiler->id}";
     $data = new ActiveDataProvider(['query' => DurationGraph::getQuery($id), 'pagination' => ['pageSize' => self::PAGE_SIZE], 'sort' => false]);
     return $this->render('detail.tpl', ['model' => $project, 'profiler' => $profiler, 'data' => $data, 'totalMessage' => Profiler::find()->where(['message_id' => $id])->count(), 'total' => ListProfiler::find()->where(['project_id' => $project->id])->count()]);
 }