当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPWS_DB::getAssoc方法代码示例

本文整理汇总了PHP中PHPWS_DB::getAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_DB::getAssoc方法的具体用法?PHP PHPWS_DB::getAssoc怎么用?PHP PHPWS_DB::getAssoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPWS_DB的用法示例。


在下文中一共展示了PHPWS_DB::getAssoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     $this->checkinCounts = PHPWS_DB::getAssoc("select hall_name, count(*) from hms_checkin JOIN hms_hall_structure ON hms_checkin.bed_id = hms_hall_structure.bedid WHERE term = {$this->term} and checkout_date IS NULL GROUP BY hall_name ORDER BY hall_name");
     if (PHPWS_Error::isError($this->checkinCounts)) {
         throw new DatabaseException($this->checkinCounts->toString());
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:7,代码来源:CheckinsByHall.php

示例2: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     foreach ($this->getHalls() as $hall) {
         $hallCount = PHPWS_DB::getAssoc("select reason, count(*) from hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id JOIN hms_residence_hall ON hms_floor.residence_hall_id = hms_residence_hall.id where hms_residence_hall.id = {$hall->getId()} AND hms_assignment.term = {$this->getTerm()} group by reason order by reason");
         if (PHPWS_Error::isError($hallCount)) {
             throw new DatabaseException($hallCount->toString());
         }
         $this->hallCounts[$hall->getId()] = $hallCount;
         $floors = $hall->get_floors();
         foreach ($floors as $floor) {
             $floorCount = PHPWS_DB::getAssoc("select reason, count(*) from hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id where hms_floor.id = {$floor->getId()} AND hms_assignment.term = {$this->getTerm()} group by reason order by reason");
             if (PHPWS_Error::isError($floorCount)) {
                 throw new DatabaseException($floorCount->toString());
             }
             $this->floorCounts[$floor->getId()] = $floorCount;
         }
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:19,代码来源:AssignmentTypeByFloor.php


注:本文中的PHPWS_DB::getAssoc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。