Exemplo n.º 1
0
 /**
  * @usage 根据examinee_id 选择出该被试的相关试卷的答案
  * @notice 一个人最多有6条记录
  * @param int $examinee_id
  * @throws Exception
  * @return array
  */
 public static function getListByExamineeId($examinee_id)
 {
     if (DBHandle::dataFormatCheck($examinee_id) != 2) {
         throw new Exception('input type is not available');
     }
     return self::find(array("examinee_id = :examinee_id:", 'bind' => array('examinee_id' => intval($examinee_id))));
 }
Exemplo n.º 2
0
 public function uploadchildrenofindexAction()
 {
     die('finished -|-_-|-');
     try {
         $file_path = './comment/childrenOfIndexComment.xlsx';
         set_time_limit(0);
         $childHandler = new ExcelUpload($file_path);
         $data = $childHandler->handleChildComment();
         $dbHandle = new DBHandle();
         $dbHandle->insertChildIndexComment($data);
         echo 'finished';
     } catch (Exception $e) {
         echo $e->getMessage();
         return false;
     }
 }
Exemplo n.º 3
0
 /**
  * 根据Paper_id 获取相应试卷的具体题目情况
  * 返回值 [phalcon_mvc_model_object_array] 返回数组的项可能为空,需判断处理
  * @param $paper_id;
  */
 public static function getQuestionsByPaperId($paper_id)
 {
     $data_type = DBHandle::dataFormatCheck($paper_id);
     if ($data_type != 2) {
         throw new Exception("input type is not available");
     }
     $question_object_array = self::find(array("paper_id = :paper_id:", 'bind' => array('paper_id' => $paper_id)));
     return $question_object_array;
 }
Exemplo n.º 4
0
 /**
  * 按照ids_array 返回响应的results_array
  * $ids_array 不能为空, 否则抛出  Empty Exception
  * 返回值 [phalcon_mvc_model_object_array] 返回数组的项可能为空,需判断处理
  * @param array $ids_array
  */
 public static function getListByIdsArray($ids_array)
 {
     $data_type = DBHandle::dataFormatCheck($ids_array);
     if ($data_type != 4) {
         throw new Exception("input type is not available!");
     }
     $rtn_array = null;
     #If you bind arrays in bound parameters, keep in mind, that keys must be numbered from zero:
     $ids_array = array_values($ids_array);
     $rtn_array = self::find(array("id IN ({name:array})", 'bind' => array('name' => $ids_array)));
     return $rtn_array;
 }