add user-questionnaire, response, question, answers to api

This commit is contained in:
iIronside
2021-10-28 10:46:59 +03:00
parent 84ec9ef9c7
commit 79c197f673
9 changed files with 1743 additions and 2 deletions

View File

@ -125,4 +125,12 @@ class Answer extends \yii\db\ActiveRecord
->andWhere('status=1')
->count();
}
public static function getActiveAnswers($question_id)
{
return self::find()->where(['question_id' => $question_id])
->andWhere(['status' => '1'])
->AsArray()
->all();
}
}