/** **显示一个事件详情,包括涉事儿童信息和当前节点简要信息. * @param $id * @return string * @throws HttpException */ public function actionEvent($id) { /** @var LocationNew $location_new */ $location_new = LocationNew::find()->where('event_id=:event_id and is_reliable=1', [':event_id' => $id])->with('provider')->orderBy('occur_at DESC')->one(); /** @var Event $event */ $event = Event::find()->where('id=:id', [':id' => $id])->with(['user', 'profiles'])->one(); if (!$location_new || !$event) { throw new HttpException(404, 'The resource you request does not exist'); } return $this->render('event', ['event' => $event, 'profile' => $event->profiles[0], 'location_new' => $location_new, 'provider' => $location_new->provider]); }