Пример #1
0
 public function getAllBadComment($intPage = 0, $selectField = '*', $whereClause = '', $orderBy = '')
 {
     if ($whereClause) {
         $whereClause = ' WHERE ' . $whereClause . ' AND  CommentID IN (SELECT CommentID FROM sl_comment_bad)';
     } else {
         $whereClause = ' WHERE  CommentID IN (SELECT CommentID FROM sl_comment_bad)';
     }
     if ($orderBy) {
         $orderBy = ' ORDER BY ' . $orderBy;
     }
     if (!$selectField) {
         $selectField = '*';
     }
     if ($intPage > 0) {
         $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Comment::TBL_SL_COMMENT, $whereClause . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     } else {
         $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Comment::TBL_SL_COMMENT, $whereClause . $orderBy));
     }
     //echo '<br>SQL:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('function getCommentByIDs:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     $arrResult = global_common::mergeReporterInfo($arrResult);
     //echo 'Before merge comment info';
     $arrResult = global_common::mergeUserInfo($arrResult);
     //echo 'End merge comment info';
     return $arrResult;
 }