示例#1
0
 protected function loadReplyList()
 {
     $this->num_per_page = $this->db->real_escape_string($this->num_per_page);
     $this->page_num = $this->db->real_escape_string($this->page_num);
     $this->newsID = trim($this->db->real_escape_string($this->newsID));
     $start_record = $this->page_num * $this->num_per_page;
     $query = "select nr.*, ur.UserID, ur.displayName, ur.fullname, ur.fbName, \n\t\t\t\t\tnr.createdDateTime as replyCreatedDateTime from `news_reply` nr \n\t\t\t\t\tinner join user_registration ur on ur.userID = nr.userID\n\t\t\t\t\twhere nr.replyStatus = 'active'\n\t\t\t\t\tand nr.newsID = {$this->newsID} and parentReplyID = 0\n\t\t\t\t\torder by nr.createdDateTime desc limit {$start_record}, {$this->num_per_page}";
     $resultArr = $this->db->query($query);
     if (is_array($resultArr) && count($resultArr) > 0) {
         $replyObj = new Reply(0, $this->withSubReplies);
         foreach ($resultArr as $id => $reply) {
             $replyResult = $replyObj->setModelReply($reply)->getArray();
             $resultArr[$id] = $replyResult["reply"];
         }
         $this->replyArr["replyList"] = $resultArr;
     }
 }