示例#1
0
 public function findAll($recruitID)
 {
     $sql = "select * from rfollow join user on rfollow.userID = user.userID where recruitID={$recruitID} ";
     //         echo $sql;
     $statement = $this->dbAdapter->query($sql);
     $result = $statement->execute();
     //         foreach ($result as $row){
     //             Debug::dump($row);
     //         }
     if ($result instanceof ResultInterface && $result->isQueryResult()) {
         $resultSet = new WHydrateResultset($this->hydrator, $this->rfollowPrototype, $this->prototypeArr);
         $tmp = $resultSet->initialize($result);
         //              foreach ($resultSet as $row){
         //                  Debug::dump($row);
         //              }
         return $tmp;
     }
     return array();
 }
 public function findAll($secID, $ptype, $schID)
 {
     $sql = "select * from page ";
     $sql = $sql . " join user on page.userID=user.userID ";
     $sql = $sql . "where ";
     if ($secID != 0) {
         $sql = $sql . " secID={$secID} ";
         if ($ptype != 0) {
             $sql = $sql . ' and ';
         }
     }
     if ($ptype != 0) {
         $sql = $sql . " ptype={$ptype} ";
     }
     if ($ptype != 0 || $secID != 0) {
         $sql = $sql . ' and ';
     }
     if ($schID != 0) {
         $sql = $sql . '(pallow=1 or (pallow=0 and schID=' . $schID . ' ))';
     } else {
         $sql = $sql . '(pallow=1)';
     }
     //         echo $sql;
     $statement = $this->dbAdapter->query($sql);
     $result = $statement->execute();
     //         foreach ($result as $row){
     //             Debug::dump($row);
     //         }
     if ($result instanceof ResultInterface && $result->isQueryResult()) {
         $resultSet = new WHydrateResultset($this->hydrator, $this->pagePrototype, $this->prototypeArr);
         $tmp = $resultSet->initialize($result);
         //              foreach ($resultSet as $row){
         //                  Debug::dump($row);
         //              }
         return $tmp;
     }
     return array();
 }
示例#3
0
 public function findRec()
 {
     if (WAuthUtil::get_auth() !== null) {
         $userId = WAuthUtil::get_auth()->userID;
         $sql = "select page.*,predictRating,user.* from (recs join page  on recs.pageId = page.pageID)join user on recs.userId = user.userId where \n                recs.userId = {$userId} and predictRating <> 0 order by predictRating desc";
         $statement = $this->dbAdapter->query($sql);
         $result = $statement->execute();
         if ($result instanceof ResultInterface && $result->isQueryResult()) {
             $resultSet = new WHydrateResultset($this->hydrator, $this->pagePrototype, $this->prototypeArr);
             $tmp = $resultSet->initialize($result);
             //              foreach ($resultSet as $row){
             //                  Debug::dump($row);
             //              }
             return $tmp;
         }
         throw new \InvalidArgumentException("Forum with given ID:{$id} not found.");
     } else {
         return null;
     }
 }
示例#4
0
 public function findSimi($userId)
 {
     $sql = "select user.userID userID,username,recruitID,rtitle,faceimgpath  from (recfris join recruit on recfris.friendId = recruit.userID) \n            join user on recfris.friendId = user.userID\n             where recfris.userId = {$userId} \n            order by simi desc";
     $statement = $this->dbAdapter->query($sql);
     $result = $statement->execute();
     //                  foreach ($result as $row){
     //                      Debug::dump($row);
     //                  }
     if ($result instanceof ResultInterface && $result->isQueryResult()) {
         $resultSet = new WHydrateResultset($this->hydrator, $this->recruitPrototype, $this->prototypeArr);
         $tmp = $resultSet->initialize($result);
         //                           foreach ($resultSet as $row){
         //                               Debug::dump($row);
         //                           }
         return $tmp;
     }
     return array();
 }