From dc2878d51929da8117cda4c1319cf9d491688227 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 19 Nov 2017 18:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/question/view.php | 8 +++--- models/Question.php | 33 +++++++++++++++++++++- models/QuestionAttention.php | 47 ++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 models/QuestionAttention.php diff --git a/frontend/views/question/view.php b/frontend/views/question/view.php index fd5d8f7..f80e769 100644 --- a/frontend/views/question/view.php +++ b/frontend/views/question/view.php @@ -62,7 +62,7 @@ class="fa fa-database"> 追加悬赏 - 'question', 'source_id' => $model->id, 'hide_cancel' => false]) ?> + 'question', 'model_id' => $model->id, 'hide_cancel' => false]) ?> - 'answer', 'source_id' => $bestAnswer->id, 'hide_cancel' => false]) ?> + 'answer', 'model_id' => $bestAnswer->id, 'hide_cancel' => false]) ?>
@@ -187,7 +187,7 @@ class="text-muted"> - user->profile->city ?>
  • - user->isGuest && Yii::$app->user->identity->isFollowed($model, $model->id)): ?> + user->isGuest && $model->isFollowed(Yii::$app->user->getId())): ?>
  • - user->isGuest && Yii::$app->user->identity->isCollected($model, $model->id)): ?> + user->isGuest && $model->isCollected(Yii::$app->user->getId())): ?>