예제 #1
0
 public function countAnswer($answerId)
 {
     $criteria = new CDbCriteria();
     $criteria->condition = "questionId=:questionId and find_in_set('" . $answerId . "',content)";
     $criteria->params = array(':questionId' => $this->questionId);
     $count = QuestionResponse::model()->count($criteria);
     return $count;
 }
예제 #2
0
 public function userResponse($userId)
 {
     $response = QuestionResponse::model()->findByAttributes(array('questionId' => $this->id, 'userId' => $userId));
     return $response;
 }