/** * @return \yii\db\ActiveQuery */ public function getNotices() { return $this->hasMany(Notice::className(), ['updated_by' => 'user_id']); }
public function getNotices() { return $this->hasMany(Notice::className(), ['target_id' => 'id'])->where(['status' => 0])->orderBy(['updated_at' => SORT_DESC]); }