• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BOL_UserDao类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getInstance

 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_UserDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:12,代码来源:user_dao.php


示例2: findUsers

 public function findUsers($groupId, $count, $withPhoto = true)
 {
     $userTable = BOL_UserDao::getInstance()->getTableName();
     $avatarJoin = !$withPhoto ? '' : "INNER JOIN `" . BOL_AvatarDao::getInstance()->getTableName() . "` as `a`\n    \t\t\tON( `u`.`id` = `a`.`userId` )";
     $query = "\n            SELECT `u`.* FROM `{$userTable}` AS `u`\n\n            INNER JOIN `" . GROUPS_BOL_GroupUserDao::getInstance()->getTableName() . "` AS `g`\n                    ON( `u`.`id` = `g`.`userId` )\n\n            LEFT JOIN `" . BOL_UserSuspendDao::getInstance()->getTableName() . "` as `s`\n                    ON( `u`.`id` = `s`.`userId` )\n\n            LEFT JOIN `" . BOL_UserApproveDao::getInstance()->getTableName() . "` as `d`\n                    ON( `u`.`id` = `d`.`userId` )\n\n            {$avatarJoin}\n\n            WHERE g.groupId=:g AND `s`.`id` IS NULL AND `d`.`id` IS NULL\n            ORDER BY `u`.`activityStamp` DESC\n            LIMIT :ls, :le";
     return OW::getDbo()->queryForObjectList($query, BOL_UserDao::getInstance()->getDtoClassName(), array('ls' => 0, 'le' => $count, 'g' => $groupId));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:groups_bridge.php


示例3: fillData

 public function fillData($period, $defaultSchedules)
 {
     $usersDao = BOL_UserDao::getInstance();
     $scheduleDao = NOTIFICATIONS_BOL_ScheduleDao::getInstance();
     $query = "REPLACE INTO " . $this->getTableName() . " (`userId`, `timeStamp`) SELECT DISTINCT u.id, UNIX_TIMESTAMP() FROM " . $usersDao->getTableName() . " u\n                    LEFT JOIN " . $scheduleDao->getTableName() . " s ON u.id = s.userId\n                    WHERE (IF( s.schedule IS NULL, :ds, s.schedule )=:as  AND u.activityStamp < :as ) OR IF( s.schedule IS NULL, :ds, s.schedule )=:is ORDER BY u.activityStamp DESC";
     return $this->dbo->query($query, array('as' => time() - $period, 'ds' => $defaultSchedules, 'is' => NOTIFICATIONS_BOL_Service::SCHEDULE_IMMEDIATELY, 'as' => NOTIFICATIONS_BOL_Service::SCHEDULE_AUTO));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:send_queue_dao.php


示例4: findByTypeId

 /**
  * Finds users by membership type
  * 
  * @param int $typeId
  * @param int $page
  * @param int $onPage
  */
 public function findByTypeId($typeId, $page, $onPage)
 {
     $limit = (int) $onPage;
     $first = ($page - 1) * $limit;
     $sql = "SELECT `m`.*\n            FROM `" . $this->getTableName() . "` AS `m`\n            LEFT JOIN `" . BOL_UserDao::getInstance()->getTableName() . "` AS `u` ON (`u`.`id` = `m`.`userId`)\n            WHERE `m`.`typeId` = :typeId\n            ORDER BY `u`.`activityStamp` DESC\n            LIMIT :first, :limit";
     return $this->dbo->queryForList($sql, array('typeId' => $typeId, 'first' => $first, 'limit' => $limit));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:14,代码来源:membership_user_dao.php


示例5: __construct

 /**
  * Class constructor
  */
 private function __construct()
 {
     $this->sectionDao = FORUM_BOL_SectionDao::getInstance();
     $this->groupDao = FORUM_BOL_GroupDao::getInstance();
     $this->topicDao = FORUM_BOL_TopicDao::getInstance();
     $this->postDao = FORUM_BOL_PostDao::getInstance();
     $this->userDao = BOL_UserDao::getInstance();
 }
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:11,代码来源:forum_service.php


示例6: login

 public function login(array $params)
 {
     $required_data = array("username", "password");
     foreach ($required_data as $rdata) {
         if (!array_key_exists($rdata, $post) || empty($post[$rdata])) {
             $return = array("response_message" => "Please enter " . $rdata, "response_status" => "0");
             echo json_encode($return);
             exit;
         }
     }
     if (empty($post["username"]) || empty($post["password"])) {
         throw new ErrorException();
     }
     $deviceId = $post["token"];
     $deviceType = $post["type"];
     $email_check = BOL_UserDao::getInstance()->findUserByUsernameOrEmail($post["username"]);
     $email_exits = count($email_check);
     if ($email_exits != '1') {
         $messages = "Sorry!!! Your Username or Email is not registered";
         $return_data = array("response_status" => '0', "response_message" => $messages);
         echo json_encode($return_data);
         exit;
     } else {
         $result = OW::getUser()->authenticate(new BASE_CLASS_StandardAuth($post["username"], $post["password"]));
         if (!$result->isValid()) {
             $messages = $result->getMessages();
             $messages = "Sorry!!! Your password doesn’t match. Please try again";
             $return_data = array("response_status" => '0', "response_message" => $messages);
             echo json_encode($return_data);
             exit;
         } else {
             $token = OW_Auth::getInstance()->getAuthenticator()->getId();
             $tokenauth = new OW_TokenAuthenticator($token);
             $service = PHOTO_BOL_PhotoService::getInstance();
             $this->user = BOL_UserService::getInstance()->findUserById($result->getUserId());
             $email = $this->user->getEmail();
             $account_type = $this->user->getAccountType();
             if ($account_type == "8cc28eaddb382d7c6a94aeea9ec029fb") {
                 $sex = "lady";
             } else {
                 $sex = "gentleman";
             }
             $username = $this->user->getUsername();
             $user_id = $result->getUserId();
             $avatars = BOL_AvatarService::getInstance()->getAvatarsUrlList(array($user_id));
             $check_exist_value = SKAPI_BOL_Service::getInstance()->findValueExistOrNot($user_id);
             $user_skapi_id = $check_exist_value[0]->id;
             $user_details = SKAPI_BOL_Service::getInstance()->createUserDetails($user_id, $deviceId, $deviceType, $user_skapi_id);
             $messages = "Login Successfully";
             $return_data = array("response_status" => '1', "response_message" => $messages, "data" => array("user_id" => $user_id, "user_name" => $username, "email" => $email, "profile_picture" => $avatars[$user_id], "user_type" => $sex));
             echo json_encode($return_data);
             //return true;
         }
     }
     exit;
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:56,代码来源:__api.php


示例7: findSearchResultListOrderedByRecentlyJoined

 public function findSearchResultListOrderedByRecentlyJoined($userIdList, $first, $count)
 {
     if (empty($userIdList)) {
         return array();
     }
     $queryParts = BOL_UserDao::getInstance()->getUserQueryFilter("user", "id", array("method" => "USEARCH_BOL_SearchDao::findSearchResultListOrderedByRecentlyJoined"));
     $where = '';
     $sql = "SELECT `user`.* FROM `" . BOL_UserDao::getInstance()->getTableName() . "` `user`\n            {$queryParts["join"]}\n                \n            WHERE `user`.`id` IN (" . $this->dbo->mergeInClause($userIdList) . ") {$where}\n            ORDER BY user.joinStamp DESC, `user`.`activityStamp` DESC  LIMIT :from, :count  ";
     return $this->dbo->queryForObjectList($sql, $this->getDtoClassName(), array('from' => (int) $first, 'count' => (int) $count));
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:10,代码来源:search_dao.php


示例8: findUserIdListForNotify

 public function findUserIdListForNotify($timeStamp, $first, $count = BOOKMARKS_BOL_Service::COUNT_CRON_USER)
 {
     if (empty($timeStamp)) {
         return array();
     }
     $sql = 'SELECT `id`
             FROM `' . BOL_UserDao::getInstance()->getTableName() . '`
             WHERE `activityStamp` <= :stamp AND `id` NOT IN (
                 SELECT `userId`
                 FROM `' . $this->getTableName() . '`)
             LIMIT :first, :count';
     return $this->dbo->queryForColumnList($sql, array('stamp' => $timeStamp, 'first' => (int) $first, 'count' => (int) $count));
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:13,代码来源:notify_log_dao.php


示例9: findUserListForInvite

 public function findUserListForInvite($eventId, $first, $count, $friendList = null)
 {
     $userDao = BOL_UserDao::getInstance();
     $eventDao = EVENTX_BOL_EventDao::getInstance();
     $eventUserDao = EVENTX_BOL_EventUserDao::getInstance();
     $where = "";
     if (isset($friendList) && empty($friendList)) {
         return array();
     } else {
         if (!empty($friendList)) {
             $where = " AND `u`.id IN ( " . $this->dbo->mergeInClause($friendList) . " ) ";
         }
     }
     $query = "SELECT `u`.`id`\n    \t\tFROM `{$userDao->getTableName()}` as `u`\n            LEFT JOIN `" . $eventDao->getTableName() . "` as `e`\n    \t\t\tON( `u`.`id` = `e`.`userId` AND e.id = :event )\n            LEFT JOIN `" . $this->getTableName() . "` as `ei`\n    \t\t\tON( `u`.`id` = `ei`.`userId` AND `ei`.eventId = :event )\n\n            LEFT JOIN `" . $eventUserDao->getTableName() . "` as `eu`\n    \t\t\tON( `u`.`id` = `eu`.`userId` AND `eu`.eventId = :event )\n\n    \t\tLEFT JOIN `" . BOL_UserSuspendDao::getInstance()->getTableName() . "` as `s`\n    \t\t\tON( `u`.`id` = `s`.`userId` )\n\n    \t\tLEFT JOIN `" . BOL_UserApproveDao::getInstance()->getTableName() . "` as `d`\n    \t\t\tON( `u`.`id` = `d`.`userId` )\n\n    \t\tWHERE `e`.`id` IS NULL AND `ei`.`id` IS NULL AND `s`.`id` IS NULL AND `d`.`id` IS NULL AND `eu`.`id` IS NULL " . $where . "\n    \t\tORDER BY `u`.`activityStamp` DESC\n    \t\tLIMIT :first, :count ";
     return $this->dbo->queryForColumnList($query, array('event' => $eventId, 'first' => $first, 'count' => $count));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:16,代码来源:event_invite_dao.php


示例10: getNewUsersThisMonth

 public function getNewUsersThisMonth($first, $count)
 {
     $query = "SELECT `u`.* FROM `" . BOL_UserDao::getInstance()->getTableName() . "` as `u`\n\t    \tLEFT JOIN `" . BOL_UserSuspendDao::getInstance()->getTableName() . "` as `s`\n\t    \t\tON( `u`.`id` = `s`.`userId` )\n            LEFT JOIN `" . BOL_UserApproveDao::getInstance()->getTableName() . "` as `d`\n                ON( `u`.`id` = `d`.`userId` )\n\t    \tWHERE `s`.`id` IS NULL AND `d`.`id` IS NULL\n\t    \tAND `u`.`joinStamp` >= :ts\n\t    \tORDER BY `u`.`joinStamp` DESC\n\t    \tLIMIT :first, :count";
     return OW::getDbo()->queryForObjectList($query, BOL_UserDao::getInstance()->getDtoClassName(), array('ts' => time() - 30 * 24 * 3600, 'first' => $first, 'count' => $count));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:5,代码来源:service.php


示例11: findPhotoListByUserIdList

 public function findPhotoListByUserIdList(array $userIdList, $first, $limit, $checkPrivacy = NULL)
 {
     if (count($userIdList) === 0) {
         return array();
     }
     $sql = 'SELECT `p`.*, `a`.`userId`
         FROM `' . $this->getTableName() . '` AS `p`
             INNER JOIN `' . PHOTO_BOL_PhotoAlbumDao::getInstance()->getTableName() . '` AS `a` ON (`p`.`albumId` = `a`.`id`)
             INNER JOIN `' . BOL_UserDao::getInstance()->getTableName() . '` AS `u` ON (`u`.`id` = `a`.`userId`)
         WHERE `a`.`userId` IN(' . implode(',', array_map('intval', array_unique($userIdList))) . ') AND `p`.`status` = :status' . ($checkPrivacy !== NULL ? $checkPrivacy ? ' AND (`p`.`' . self::PRIVACY . '` = :everybody OR `p`.`' . self::PRIVACY . '` = :friends)' : ' AND `p`.`' . self::PRIVACY . '` = :everybody' : '') . '
         ORDER BY `u`.`username`
         LIMIT :first, :limit';
     $params = array('first' => (int) $first, 'limit' => (int) $limit, 'status' => 'approved');
     if ($checkPrivacy !== NULL) {
         switch ($checkPrivacy) {
             case TRUE:
                 $params['friends'] = self::PRIVACY_FRIENDS_ONLY;
             case FALSE:
                 $params['everybody'] = self::PRIVACY_EVERYBODY;
         }
     }
     return $this->dbo->queryForList($sql, $params);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:23,代码来源:photo_dao.php


示例12: countRateUsers

 public function countRateUsers($userId)
 {
     $rateDao = BOL_RateDao::getInstance();
     $userDao = BOL_UserDao::getInstance();
     $sql = "SELECT COUNT(*)\n            FROM `" . $rateDao->getTableName() . "` AS `r`\n            INNER JOIN `" . $userDao->getTableName() . "` AS `u` ON (`u`.`id` = `r`.`userId`) \n            WHERE `entityId` = :entityId AND `entityType` = 'user_rates'";
     return (int) OW::getDbo()->queryForColumn($sql, array('entityId' => $userId));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:service.php


示例13: getUserIdList

 private function getUserIdList($userId)
 {
     return $this->getUserIdListAlt($userId);
     $friendsEnabled = (bool) OW::getEventManager()->call('plugin.friends');
     if ($friendsEnabled) {
         $friendIdList = OW::getEventManager()->call('plugin.friends.get_friend_list', array('userId' => $userId));
     } else {
         $friendIdList = array();
     }
     $userIdList = array();
     $userWithCorrespondenceIdList = $this->getUserListWithCorrespondence();
     foreach ($userWithCorrespondenceIdList as $id) {
         $userIdList[] = $id;
     }
     $queryParts = BOL_UserDao::getInstance()->getUserQueryFilter("u", "id", array("method" => "BOL_UserDao::findList"));
     $correspondenceCondition = "";
     if (!empty($userWithCorrespondenceIdList)) {
         $correspondenceCondition = " AND `u`.`id` NOT IN ( " . OW::getDbo()->mergeInClause($userWithCorrespondenceIdList) . " ) ";
     }
     $query = "SELECT `u`.`id`\r\n            FROM `" . BOL_UserDao::getInstance()->getTableName() . "` as `u`\r\n            {$queryParts["join"]}\r\n\r\n            WHERE {$queryParts["where"]} " . $correspondenceCondition;
     $tmpUserIdList = OW::getDbo()->queryForColumnList($query);
     foreach ($tmpUserIdList as $id) {
         if ($id == $userId) {
             continue;
         }
         if (!in_array($id, $userIdList)) {
             $userIdList[] = $id;
         }
     }
     return array('userIdList' => $userIdList, 'userWithCorrespondenceIdList' => $userWithCorrespondenceIdList, 'friendIdList' => $friendIdList);
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:31,代码来源:conversation_service.php


示例14: askUsers

 private function askUsers($query, $data)
 {
     if (!OW::getUser()->isAuthenticated()) {
         return array('warning' => OW::getLanguage()->text('equestions', 'not_authed_ask_warning'));
     }
     $userIds = $query['ids'];
     $questionId = $data['questionId'];
     $question = $this->service->findQuestion($questionId);
     $params = array('userId' => OW::getUser()->getId(), 'questionId' => $questionId);
     if ($query['all']) {
         $params['special'] = true;
         $users = BOL_UserDao::getInstance()->findAll();
         foreach ($users as $user) {
             if ($user->id != $params['userId']) {
                 $userIds[] = $user->id;
             }
         }
     }
     foreach ($userIds as $uid) {
         $params['recipientId'] = $uid;
         $event = new OW_Event(EQUESTIONS_BOL_Service::EVENT_QUESTION_BEFORE_ASK, $params, $data);
         OW::getEventManager()->trigger($event);
     }
     $permissions = EQUESTIONS_CLASS_CreditsBridge::getInstance()->getAllPermissions(EQUESTIONS_CLASS_Credits::ACTION_ASK);
     return array('message' => OW::getLanguage()->text('equestions', 'question_ask_complete_msg', array('count' => count($userIds))), 'permissions' => $permissions);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:26,代码来源:questions.php


示例15: findGuestUsers

 /**
  * @param $userId
  * @param $page
  * @param $limit
  * @return array|mixed
  */
 public function findGuestUsers($userId, $page, $limit)
 {
     $first = ($page - 1) * $limit;
     $query = "SELECT `u`.*\n            FROM `" . $this->getTableName() . "` AS `g`\n            INNER JOIN `" . BOL_UserDao::getInstance()->getTableName() . "` as `u`\n                ON (`g`.`guestId` = `u`.`id`)\n            LEFT JOIN `" . BOL_UserSuspendDao::getInstance()->getTableName() . "` as `s`\n                ON( `u`.`id` = `s`.`userId` )\n            LEFT JOIN `" . BOL_UserApproveDao::getInstance()->getTableName() . "` as `d`\n                ON( `u`.`id` = `d`.`userId` )\n            WHERE `s`.`id` IS NULL AND `d`.`id` IS NULL\n            AND `g`.`userId` = ?\n            ORDER BY `g`.`visitTimestamp` DESC\n            LIMIT ?, ?";
     return $this->dbo->queryForObjectList($query, BOL_UserDao::getInstance()->getDtoClassName(), array($userId, $first, $limit));
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:12,代码来源:hammu_dao.php


示例16: findCountByGroupIdList

 public function findCountByGroupIdList($groupIdList)
 {
     if (empty($groupIdList)) {
         return array();
     }
     $queryParts = BOL_UserDao::getInstance()->getUserQueryFilter("u", "userId", array("method" => "GROUPS_BOL_GroupUserDao::findCountByGroupIdList"));
     $query = 'SELECT u.groupId, COUNT(*) count FROM ' . $this->getTableName() . ' u ' . $queryParts["join"] . ' WHERE ' . $queryParts["where"] . ' AND u.groupId IN (' . implode(',', $groupIdList) . ') GROUP BY u.groupId';
     $list = $this->dbo->queryForList($query, null, GROUPS_BOL_GroupDao::LIST_CACHE_LIFETIME, array(GROUPS_BOL_GroupDao::LIST_CACHE_TAG));
     $resultList = array();
     foreach ($list as $item) {
         $resultList[$item['groupId']] = $item['count'];
     }
     foreach ($groupIdList as $groupId) {
         $resultList[$groupId] = empty($resultList[$groupId]) ? 0 : $resultList[$groupId];
     }
     return $resultList;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:17,代码来源:group_user_dao.php


示例17: findFeedActivity

 public function findFeedActivity($feedType, $feedId, $actionIds)
 {
     $actionFeedDao = NEWSFEED_BOL_ActionFeedDao::getInstance();
     $unionQueryList = array();
     $queryParts = BOL_UserDao::getInstance()->getUserQueryFilter("activity", "userId", array("method" => "NEWSFEED_BOL_ActivityDao::findFeedActivity"));
     $unionQueryList[] = 'SELECT activity.* FROM ' . $this->getTableName() . ' activity
         WHERE activity.actionId IN(' . implode(', ', $actionIds) . ') AND activity.status=:s 
         AND activity.privacy=:peb AND activity.visibility & :v
         AND activity.activityType IN ("' . implode('", "', NEWSFEED_BOL_Service::getInstance()->SYSTEM_ACTIVITIES) . '")';
     foreach ($actionIds as $actionId) {
         $unionQueryList[] = 'SELECT a.* FROM ( SELECT DISTINCT activity.* FROM ' . $this->getTableName() . ' activity
             ' . $queryParts["join"] . '
             INNER JOIN ' . $actionFeedDao->getTableName() . ' action_feed ON activity.id=action_feed.activityId
             WHERE ' . $queryParts["where"] . ' AND activity.actionId = ' . $actionId . ' AND
                 (
                     activity.status=:s
                     AND activity.privacy=:peb
                     AND action_feed.feedType=:ft
                     AND action_feed.feedId=:fi
                     AND activity.visibility & :v
                     OR
                     activity.activityType=:ac
                 )
             ORDER BY activity.timeStamp DESC, activity.id DESC LIMIT 100 ) a';
     }
     $query = implode(' UNION ', $unionQueryList) . " ORDER BY 7 DESC, 1 DESC ";
     return $this->dbo->queryForObjectList($query, $this->getDtoClassName(), array('ft' => $feedType, 'fi' => $feedId, 's' => NEWSFEED_BOL_Service::ACTION_STATUS_ACTIVE, 'v' => NEWSFEED_BOL_Service::VISIBILITY_FEED, 'peb' => NEWSFEED_BOL_Service::PRIVACY_EVERYBODY, 'ac' => NEWSFEED_BOL_Service::SYSTEM_ACTIVITY_CREATE));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:28,代码来源:activity_dao.php


示例18: countByBirthdayPeriod

 public function countByBirthdayPeriod($start, $end, $idList = null, $privacy = null)
 {
     if ($idList === array()) {
         return 0;
     }
     $queryParts = BOL_UserDao::getInstance()->getUserQueryFilter("q", "userId", array("method" => "BIRTHDAYS_BOL_UserDao::countByBirthdayPeriod"));
     $query = "SELECT COUNT(*) FROM `" . BOL_QuestionDataDao::getInstance()->getTableName() . "` q\r\n            " . $queryParts["join"] . " \r\n            " . (!empty($privacy) ? "LEFT JOIN `" . BIRTHDAYS_BOL_PrivacyDao::getInstance()->getTableName() . "` AS `bp` ON( `q`.`userId` = bp.userId AND ( bp.privacy NOT IN (" . $this->dbo->mergeInClause($privacy) . ") ) ) " : '') . "\r\n\t\t\tWHERE " . $queryParts["where"] . " AND " . (!empty($privacy) ? " `bp`.id IS NULL AND " : "") . " q.`questionName` = 'birthdate' AND\r\n            ( DATE_FORMAT(q.`dateValue`, '" . date('Y') . "-%m-%d') BETWEEN :start1 AND :end1 OR DATE_FORMAT(q.`dateValue`, '" . (intval(date('Y')) + 1) . "-%m-%d') BETWEEN :start2 AND :end2 )\r\n            " . (!empty($idList) ? "AND q.`userId` IN (" . $this->dbo->mergeInClause($idList) . ")" : '');
     return $this->dbo->queryForColumn($query, array('start1' => $start, 'start2' => $start, 'end1' => $end, 'end2' => $end));
 }
开发者ID:tammyrocks,项目名称:birthdays,代码行数:9,代码来源:user_dao.php


示例19: findSpeedmatchOpponents

 public function findSpeedmatchOpponents($userId, $first, $count, $criteria, $exclude = array())
 {
     if (!$userId) {
         return null;
     }
     if (isset($criteria['birthdate'])) {
         $range = explode('-', $criteria['birthdate']);
         if (!empty($range[0]) && !empty($range[1])) {
             $criteria['birthdate'] = array('from' => $range[0], 'to' => $range[1]);
         } else {
             unset($criteria['birthdate']);
         }
     }
     $addQuery['join'] = ' LEFT JOIN `' . $this->relationDao->getTableName() . '` AS `relation`
         ON (`user`.`id` = `relation`.`oppUserId` AND `relation`.`userId` = ' . OW::getDbo()->escapeString($userId) . ') ';
     $addQuery['where'] = ' AND `relation`.`id` IS NULL AND `user`.`id` != ' . OW::getDbo()->escapeString($userId);
     if (!empty($criteria['googlemap_location']['latitude']) && !empty($criteria['googlemap_location']['longitude'])) {
         $location = $criteria['googlemap_location'];
         unset($criteria['googlemap_location']);
         $coord = GOOGLELOCATION_BOL_LocationService::getInstance()->getNewCoordinates($location['latitude'], $location['longitude'], 225, (double) $location['distance']);
         $location['southWestLat'] = $coord['lat'];
         $location['southWestLng'] = $coord['lng'];
         $coord = GOOGLELOCATION_BOL_LocationService::getInstance()->getNewCoordinates($location['latitude'], $location['longitude'], 45, (double) $location['distance']);
         $location['northEastLat'] = $coord['lat'];
         $location['northEastLng'] = $coord['lng'];
         $sql = GOOGLELOCATION_BOL_LocationService::getInstance()->getSearchInnerJoinSql('user', $location['southWestLat'], $location['southWestLng'], $location['northEastLat'], $location['northEastLng'], null, 'LEFT');
         $locationDao = SKADATE_BOL_CurrentLocationDao::getInstance();
         $sql .= ' LEFT JOIN `' . $locationDao->getTableName() . '` current_location ON (user.id = current_location.userId
             AND (
                 current_location.latitude >= ' . $location['southWestLat'] . '
                 AND current_location.latitude <= ' . $location['northEastLat'] . '
             )
             AND (
                 current_location.longitude >= ' . $location['southWestLng'] . '
                 AND current_location.longitude <= ' . $location['northEastLng'] . '
             )) ';
         $addQuery['join'] .= $sql;
         $addQuery['where'] .= ' AND (current_location.id IS NOT NULL OR location.id IS NOT NULL) ';
         $addQuery['order'] = ' current_location.id IS NOT NULL DESC, `user`.`activityStamp` DESC ';
     }
     if (!empty($exclude)) {
         $addQuery['where'] .= ' AND `user`.`id` NOT IN (' . implode(',', array_map('intval', array_filter($exclude))) . ') ';
     }
     $idList = BOL_UserDao::getInstance()->findUserIdListByQuestionValues($criteria, $first, $count, false, $addQuery);
     return $idList;
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:46,代码来源:service.php


示例20: photoGetPhotoList

 public function photoGetPhotoList(BASE_CLASS_QueryBuilderEvent $event)
 {
     $params = $event->getParams();
     $aliases = $params['aliases'];
     if (empty($params['listType']) || !in_array($params['listType'], array('latest', 'featured', 'toprated', 'most_discussed', 'searchByDesc', 'searchByHashtag', 'searchByUsername'))) {
         return;
     }
     if (!OW::getUser()->isAuthenticated() || !(bool) OW::getConfig()->getValue('skadate', 'photo_filter_setting_matching') || OW::getUser()->isAuthorized('photo') || OW::getUser()->isAuthorized('base')) {
         return;
     }
     $userId = OW::getUser()->getId();
     $matchValue = BOL_QuestionService::getInstance()->getQuestionData(array($userId), array('sex', 'match_sex'));
     if (empty($matchValue[$userId]['match_sex'])) {
         return;
     }
     $join = 'INNER JOIN `' . BOL_UserDao::getInstance()->getTableName() . '` AS `sk_u` ON(`' . $aliases['album'] . '`.`userId` = `sk_u`.`id`)
         INNER JOIN `' . BOL_QuestionDataDao::getInstance()->getTableName() . '` AS `sk_qd` ON (`sk_qd`.`userId` = `sk_u`.`id` AND `sk_qd`.`questionName` = :sk_sexQuestionName AND `sk_qd`.`intValue` & :sk_matchSexValue)
         INNER JOIN `' . BOL_QuestionDataDao::getInstance()->getTableName() . '` AS `sk_qd1` ON (`sk_qd1`.`userId` = `sk_u`.`id` AND `sk_qd1`.`questionName` = :sk_matchSexQuestionName AND `sk_qd1`.`intValue` & :sk_sexValue)';
     $params = array('sk_sexQuestionName' => 'sex', 'sk_matchSexQuestionName' => 'match_sex', 'sk_sexValue' => $matchValue[$userId]['sex'], 'sk_matchSexValue' => $matchValue[$userId]['match_sex']);
     $event->addJoin($join);
     $event->addBatchQueryParams($params);
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:22,代码来源:event_handler.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BOL_UserService类代码示例发布时间:2022-05-23
下一篇:
PHP BOL_QuestionService类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap