Пример #1
0
 /**
  * @return Result[]
  */
 public static function getResByID($uid, $cate)
 {
     $db = DB::getConn();
     $stm = $db->prepare('select ans from Answers where uid=:uid and cate=:cate');
     $stm->bindParam(':uid', $uid);
     $stm->bindParam(':cate', $cate);
     $stm->execute();
     $rs = $stm->fetchAll();
     $arr = explode(',', $rs[0][0]);
     $temp = [];
     foreach ($arr as $a) {
         $temp[] = new Result(explode('_', $a)[2], explode('_', $a)[3], QuestionCtrl::getPoint(explode('_', $a)[0]));
     }
     return $temp;
 }