当前位置: 首页>>代码示例>>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;未经允许,请勿转载。