public function actionDetail() { $id = intval(\Yii::$app->request->get('id')); $detail = Blog::detail($id); $this->checkPermission($detail); $detail['content'] = htmlspecialchars_decode($detail['content']); Blog::readInc($id); return $this->render('/site/detail', $detail); }
public static function detail($id, array $condition = []) { return parent::detail($id, ['b.uid' => \Yii::$app->user->getId()]); }