當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPWS_DB::getCol方法代碼示例

本文整理匯總了PHP中PHPWS_DB::getCol方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_DB::getCol方法的具體用法?PHP PHPWS_DB::getCol怎麽用?PHP PHPWS_DB::getCol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHPWS_DB的用法示例。


在下文中一共展示了PHPWS_DB::getCol方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doSearch

 /**
  * Main searching function. Does the database lookup and then checks each student though the various functions.
  */
 public function doSearch()
 {
     // Clear all the caches
     StudentDataProvider::clearAllCache();
     $term = $this->term;
     $query = "select DISTINCT * FROM (select hms_new_application.username from hms_new_application WHERE term={$term} AND cancelled != 1 UNION select hms_assignment.asu_username from hms_assignment WHERE term={$term}) as foo";
     $result = PHPWS_DB::getCol($query);
     if (PHPWS_Error::logIfError($result)) {
         throw new Exception($result->toString());
     }
     foreach ($result as $username) {
         $student = null;
         try {
             $student = StudentFactory::getStudentByUsername($username, $term);
         } catch (Exception $e) {
             $this->actions[$username][] = 'WARNING!! Unknown student!';
             // Commenting out the NQ line, since this doesn't work when the search is run from cron/Pulse
             //NQ::simple('hms', hms\NotificationView::WARNING, 'Unknown student: ' . $username);
             continue;
         }
         if ($student->getType() != TYPE_WITHDRAWN && $student->getAdmissionDecisionCode() != ADMISSION_WITHDRAWN_PAID && $student->getAdmissionDecisionCode() != ADMISSION_RESCIND) {
             continue;
         }
         $this->actions[$username][] = $student->getBannerId() . ' (' . $student->getUsername() . ')';
         $this->withdrawnCount++;
         $this->handleApplication($student);
         $this->handleAssignment($student);
         $this->handleRoommate($student);
         $this->handleRlcAssignment($student);
         $this->handleRlcApplication($student);
     }
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:35,代碼來源:WithdrawnSearch.php

示例2: getRemainingWaitListApplications

 /**
  * Returns a list of usernames which are currently on the waiting list
  * (has a valid housing application, not assigned)
  *
  * @param unknown $term
  * @throws DatabaseException
  * @return unknown
  */
 public static function getRemainingWaitListApplications($term)
 {
     // Get the list of user names still on the waiting list, sorted by ID (first come, first served)
     $sql = "SELECT username FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id\n                    LEFT OUTER JOIN (SELECT asu_username FROM hms_assignment WHERE hms_assignment.term={$term}) as foo ON hms_new_application.username = foo.asu_username\n                    WHERE foo.asu_username IS NULL\n                    AND hms_new_application.term = {$term}\n                    AND special_interest IS NULL\n                    AND waiting_list_date IS NOT NULL\n                    ORDER BY application_term DESC, hms_new_application.id ASC";
     $applications = PHPWS_DB::getCol($sql);
     if (PHPWS_Error::logIfError($applications)) {
         throw new DatabaseException($applications->toString());
     }
     return $applications;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:18,代碼來源:LotteryApplication.php

示例3: _getIds

 function _getIds()
 {
     if (isset($this->_table)) {
         $table = $this->_table;
     } else {
         $table = $this->_tables[$this->listName];
     }
     $sql = 'SELECT id FROM ' . $table;
     $sort = $this->getSort();
     if (isset($sort)) {
         $sql .= $sort;
     }
     $order = $this->getOrder();
     if (isset($order)) {
         $sql .= $order;
     }
     return PHPWS_DB::getCol($sql);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:18,代碼來源:Manager.php


注:本文中的PHPWS_DB::getCol方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。