本文整理汇总了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);
}
}
示例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;
}
示例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);
}