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() {