From a70d7ad63a0b522874dc8196b5bd8c68825e53eb Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Mon, 4 Mar 2024 15:50:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AF=E4=BB=A5=E7=9C=8B?= =?UTF-8?q?=E5=88=B0=E5=85=B6=E4=BB=96=E7=94=A8=E6=88=B7=E6=94=B6=E9=9B=86?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84bug=20=E4=B8=80=E7=82=B9=E7=82=B9?= =?UTF-8?q?=E7=9A=84=E6=95=B4=E7=90=86=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/CollectionSearch.php | 5 +++-- models/CollectionTasks.php | 5 +++-- models/Share.php | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/models/CollectionSearch.php b/models/CollectionSearch.php index 2807649..882e387 100644 --- a/models/CollectionSearch.php +++ b/models/CollectionSearch.php @@ -2,6 +2,7 @@ namespace app\models; +use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use app\models\CollectionTasks; @@ -40,7 +41,7 @@ class CollectionSearch extends CollectionTasks */ public function search($params) { - $query = CollectionTasks::find(); + $query = CollectionTasks::find()->where(['user_id' => Yii::$app->user->id]); // add conditions that should always apply here @@ -59,7 +60,7 @@ class CollectionSearch extends CollectionTasks // grid filtering conditions $query->andFilterWhere([ 'id' => $this->id, - 'user_id' => $this->user_id, +// 'user_id' => $this->user_id, 'created_at' => $this->created_at, ]); diff --git a/models/CollectionTasks.php b/models/CollectionTasks.php index 9996a46..bed7b5e 100644 --- a/models/CollectionTasks.php +++ b/models/CollectionTasks.php @@ -3,6 +3,7 @@ namespace app\models; use Yii; +use yii\db\ActiveQuery; use yii\db\ActiveRecord; /** @@ -71,7 +72,7 @@ class CollectionTasks extends ActiveRecord /** * Gets query for [[CollectionUploadeds]]. * - * @return \yii\db\ActiveQuery + * @return ActiveQuery */ public function getCollectionUploadeds() { @@ -81,7 +82,7 @@ class CollectionTasks extends ActiveRecord /** * Gets query for [[User]]. * - * @return \yii\db\ActiveQuery + * @return ActiveQuery */ public function getUser() { diff --git a/models/Share.php b/models/Share.php index e16f82a..4ef6efe 100644 --- a/models/Share.php +++ b/models/Share.php @@ -3,6 +3,8 @@ namespace app\models; use Yii; +use yii\db\ActiveQuery; +use yii\db\ActiveRecord; /** * This is the model class for table "share". @@ -15,7 +17,7 @@ use Yii; * * @property User $sharer */ -class Share extends \yii\db\ActiveRecord +class Share extends ActiveRecord { const SCENARIO_UPDATE = 'update'; /** @@ -59,7 +61,7 @@ class Share extends \yii\db\ActiveRecord /** * Gets query for [[Sharer]]. * - * @return \yii\db\ActiveQuery + * @return ActiveQuery */ public function getSharer() {