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


PHP DbUtils::getDbValues方法代码示例

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


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

示例1: run

 public function run()
 {
     $userIds = null;
     if ($this->messages) {
         foreach ($this->messages as $message) {
             $userIds[] = $message->from_user_id;
         }
     }
     $first_name = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'first_name');
     $last_name = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'last_name');
     $this->render('pmbInbox', array('messages' => $this->messages, 'first_name' => $first_name, 'last_name' => $last_name, 'unread' => $this->unread, 'pages' => $this->pages));
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:12,代码来源:PmbInbox.php

示例2: actionView

 public function actionView($id)
 {
     Yii::beginProfile('requirements_view');
     //$requirements=RequirementApi::getRequirementByUserId(Yii::app()->user->id);
     //$this->render('view',array('requirements'=>$requirements));
     $session = Yii::app()->session;
     $requirement = RequirementApi::getRequirementById($id);
     if (!$requirement) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $userDetails = UserApi::getUserProfileDetails($requirement->user_id);
     $propertyIds = RequirementPropertyTypesApi::getPropertyTypesByRequirementId($id);
     $properties = "";
     $propertyNames = "";
     if ($propertyIds) {
         foreach ($propertyIds as $propertyId) {
             $properties[] = $propertyId->property_type_id;
         }
         $propertyNames = DbUtils::getDbValues(new PropertyTypes(), 'id', $properties, 'property_type');
     }
     $amenityIds = RequirementAmenitiesApi::getAmenitiesByRequirementId($id);
     $amenities = "";
     $amenityNames = "";
     if ($amenityIds) {
         foreach ($amenityIds as $amenityId) {
             $amenities[] = $amenityId->amenity_id;
         }
         $amenityNames = DbUtils::getDbValues(new CategoryAmenities(), 'id', $amenities, 'amenity');
     }
     $cityIds = RequirementCitiesApi::getCitiesByRequirementId($id);
     $cities = "";
     $cityNames = "";
     if ($cityIds) {
         foreach ($cityIds as $cityId) {
             $cities[] = $cityId->city_id;
         }
         $cityNames = DbUtils::getDbValues(new GeoCity(), 'id', $cities, 'city');
     }
     $bedroomsRequirement = RequirementBedroomsApi::getBedroomsByRequirementId($id);
     $this->render('view', array('requirement' => $requirement, 'amenityNames' => $amenityNames, 'cityNames' => $cityNames, 'propertyNames' => $propertyNames, 'bedroomsRequirement' => $bedroomsRequirement, 'userDetails' => $userDetails));
     Yii::endProfile('requirements_view');
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:42,代码来源:RequirementController.php

示例3: actionIndex

 public function actionIndex()
 {
     $userId = Yii::app()->user->id;
     $projectImages = '';
     $propertyImages = '';
     $projectCount = '';
     $propertyCount = '';
     $propertyTypes = '';
     $propertyLocations = '';
     $propertyid = '';
     $projectLocations = '';
     $projectOwnerships = '';
     $projectTypes = '';
     $users = '';
     $userIds[] = '';
     $myJukeBox = '';
     $jukeBoxcategoryName = '';
     $jukecount = '0';
     $propertyWishList = '';
     $propertyName = '';
     $projectWishlist = '';
     $projectName = '';
     $propertywishlistcount = 0;
     $inbox = PmbApi::getInbox($userId);
     $userName = UserApi::getUserProfileDetails($userId);
     if ($inbox) {
         foreach ($inbox as $messages) {
             $userIds[] = $messages->from_user_id;
         }
         $users = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'first_name');
     }
     $properties = PropertyApi::getPropertiesOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
     $countUnread = PmbApi::getUnreadInboxCount($userId);
     $propertyCount = PropertyApi::getAllPropertiesCount($userId);
     $locations = '';
     if ($properties) {
         foreach ($properties as $location) {
             $locations[] = $location->city_id;
         }
         $propertyLocations = DbUtils::getDbValues(new GeoCity(), 'id', $locations, 'city');
     }
     if ($properties) {
         foreach ($properties as $property) {
             $propertyTypes[] = $property->property_type_id;
             $propertyid[] = $property->id;
         }
         $propertyImages = PropertyImagesApi::getPrimaryImageForProperties($propertyid);
         $propertyTypes = DbUtils::getDbValues(new PropertyTypes(), 'id', $propertyTypes, 'property_type');
     }
     $projects = ProjectApi::getProjectsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
     if ($projects) {
         foreach ($projects as $project) {
             $projectLocationIds[] = $project->city_id;
             $projectTypeIds[] = $project->project_type_id;
             $projectOwnershipIds[] = $project->ownership_type_id;
             $projectIds[] = $project->id;
         }
         $projectImages = ProjectImagesApi::getPrimaryImageForProjects($projectIds);
         $projectLocations = DbUtils::getDbValues(new GeoCity(), 'id', $projectLocationIds, 'city');
         $projectTypes = DbUtils::getDbValues(new ProjectTypes(), 'id', $projectTypeIds, 'project_type');
         $projectOwnerships = DbUtils::getDbValues(new CategoryOwnershipTypes(), 'id', $projectOwnershipIds, 'ownership_type');
     }
     $projectCount = ProjectApi::getProjectsofUserCount($userId);
     $isProfile['agent'] = AgentProfileApi::isAgent($userId);
     $isProfile['builder'] = BuilderProfileApi::isBuilder($userId);
     $isProfile['specialist'] = SpecialistProfileApi::isSpecialist($userId);
     //MyJuckbox
     $myJukeBox = JukeboxQuestionsApi::getAllJukeboxQuestionsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
     if ($myJukeBox) {
         foreach ($myJukeBox as $jukeBox) {
             $categoryIdArray[] = $jukeBox->category_id;
         }
         $jukeBoxcategoryName = DbUtils::getDbValues(new JukeboxCategory(), 'id', $categoryIdArray, 'category');
         $jukecount = count($myJukeBox);
     }
     //my wishlists
     $propertyWishList = PropertyWishlistApi::getWishlist($userId, Yii::app()->params['dashboardResultsPerPage']);
     if ($propertyWishList) {
         foreach ($propertyWishList as $propertyWish) {
             $propertyWishlistArray[] = $propertyWish->property_id;
         }
         $propertyName = DbUtils::getDbValues(new Property(), 'id', $propertyWishlistArray, 'property_name');
     }
     $propertywishlistcount = PropertyWishlistApi::getWishlistCount($userId);
     $totalWishlistCount = $propertywishlistcount;
     //+$projectwishlistcount;
     //requirements
     $requirements = RequirementApi::getRequirementByUserId($userId, Yii::app()->params['dashboardResultsPerPage']);
     if ($requirements) {
         $requirementscount = count($requirements);
     } else {
         $requirementscount = 0;
     }
     $this->render('index', array('inbox' => $inbox, 'users' => $users, 'properties' => $properties, 'countUnread' => $countUnread, 'propertyLocations' => $propertyLocations, 'propertyTypes' => $propertyTypes, 'projects' => $projects, 'projectLocations' => $projectLocations, 'projectTypes' => $projectTypes, 'projectOwnerships' => $projectOwnerships, 'propertyCount' => $propertyCount, 'projectCount' => $projectCount, 'propertyid' => $propertyid, 'propertyImages' => $propertyImages, 'projectImages' => $projectImages, 'isProfile' => $isProfile, 'myJukeBox' => $myJukeBox, 'jukeBoxcategoryName' => $jukeBoxcategoryName, 'jukecount' => $jukecount, 'propertyWishList' => $propertyWishList, 'propertyName' => $propertyName, 'projectName' => $projectName, 'totalWishlistCount' => $totalWishlistCount, 'requirements' => $requirements, 'requirementscount' => $requirementscount, 'userName' => $userName));
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:95,代码来源:AccountController.php

示例4: foreach

    echo $specialistProfile->email;
    ?>
</p>
             <br class="clear" />
             </td>
      </tr>
    </table>

            <br class="clear" />
        <?php 
    if ($specialistProjects) {
        $specialistIds = null;
        foreach ($specialistProjects as $specialistProject) {
            $specialistIds[] = $specialistProject->specialist_type_id;
        }
        $specialists = DbUtils::getDbValues(new Specializations(), 'id', $specialistIds, 'specialist');
        echo '<div class="specialist_project_details"><h1>Project Details</h1><ul>';
        foreach ($specialistProjects as $specialistProject) {
            echo '<li><img src="images/photo1.jpg" alt="" class="left" /> 
		                <div class="right" style="width:550px;">
		                <h2>' . $specialistProject->project_name . '</h2>
		                <p class="red-txt"><b>' . $specialists[$specialistProject->specialist_type_id] . '</b> </p>
		                <p>' . $specialistProject->description . '</p>
		                </div>
		                <br class="clear" />
		                </li>';
        }
        echo '</ul></div>';
    }
    ?>
    </div>
开发者ID:romeo14,项目名称:wallfeet,代码行数:31,代码来源:profile.php

示例5: getAmenitiesById

 public static function getAmenitiesById($amenitiesId)
 {
     return DbUtils::getDbValues(new CategoryAmenities(), 'id', $amenitiesId, 'amenity ');
     $models = CategoryAmenities::model()->findAllBySql("SELECT * FROM category_amenities where id IN\n\t\t(SELECT amenity_id FROM property_amenities WHERE property_id=:propertyId)", array(':propertyId' => $propertyId));
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:5,代码来源:PropertyAmenitiesApi.php


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