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


PHP OW_Example::andFieldGreaterThan方法代码示例

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


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

示例1: sendExpiryEmail

 public function sendExpiryEmail()
 {
     $config = OW::getConfig();
     $subject = OW::getLanguage()->text('sponsors', 'reminder_subject');
     $content = OW::getLanguage()->text('sponsors', 'reminder_content');
     $sitemail = $config->getValue('base', 'site_email');
     $sitename = $config->getValue('base', 'site_name');
     $mails = array();
     $example = new OW_Example();
     $example->andFieldEqual('status', 1);
     $example->andFieldGreaterThan('price', 0);
     $sponsors = $this->dao->findListByExample($example);
     foreach ($sponsors as $sponsor) {
         $cutoffDay = $sponsor->validity - (int) OW::getConfig()->getValue('sponsors', 'cutoffDay');
         if ((time() - $sponsor->timestamp) / 86400 > $cutoffDay && $cutoffDay > 0) {
             $mail = OW::getMailer()->createMail();
             $mail->addRecipientEmail($sponsor->email);
             $mail->setSender($sitemail, $sitename);
             $mail->setSubject($subject);
             $mail->setHtmlContent($content);
             $textContent = strip_tags(preg_replace("/\\<br\\s*[\\/]?\\s*\\>/", "\n", $content));
             $mail->setTextContent($textContent);
             $mails[] = $mail;
         }
     }
     if (count($mails) > 0) {
         OW::getMailer()->addListToQueue($mails);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:29,代码来源:service.php

示例2: findList

 /**
  * Finds action list by type
  * 
  * @param string $type
  */
 public function findList($type)
 {
     $example = new OW_Example();
     if ($type == 'earn') {
         $example->andFieldGreaterThan('amount', 0);
     } else {
         if ($type == 'lose') {
             $example->andFieldLessThan('amount', 0);
         } else {
             if ($type == 'unset') {
                 $example->andFieldEqual('amount', 0);
             }
         }
     }
     $example->andFieldEqual('isHidden', 0);
     $example->andFieldEqual('active', 1);
     return $this->findListByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:23,代码来源:action_dao.php

示例3: findNotUpdatedMessages

 /**
  * don't call this function
  * This is a temporary method used for mailbox plugin update.
  * 
  * @param int $messageId
  * @param int $limit
  * @return MAILBOX_BOL_Message
  */
 public function findNotUpdatedMessages($messageId, $limit = 100)
 {
     $example = new OW_Example();
     $example->andFieldGreaterThan('id', (int) $messageId);
     $example->setOrder(" id ");
     $example->setLimitClause(0, $limit);
     return $this->findListByExample($example);
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:16,代码来源:message_dao.php

示例4: getPreviousPhoto

 public function getPreviousPhoto($albumId, $id)
 {
     if (!$albumId || !$id) {
         return false;
     }
     $example = new OW_Example();
     $example->andFieldEqual('albumId', $albumId);
     $example->andFieldEqual('status', 'approved');
     $example->andFieldGreaterThan('id', $id);
     $example->setOrder('`id` ASC');
     $example->setLimitClause(0, 1);
     return $this->findObjectByExample($example);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:13,代码来源:photo_dao.php

示例5: findItemsWithInvalidLicense

 /**
  * @return array
  */
 public function findItemsWithInvalidLicense()
 {
     $example = new OW_Example();
     $example->andFieldGreaterThan(self::LICENSE_CHECK_STAMP, 0);
     return $this->findListByExample($example);
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:9,代码来源:theme_dao.php

示例6: deleteExpiredEntities

 /**
  * Deletes reset password expired entries
  */
 public function deleteExpiredEntities()
 {
     $example = new OW_Example();
     $example->andFieldGreaterThan('expirationTimeStamp', time());
     $this->deleteByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:9,代码来源:reset_password_dao.php

示例7: findPreviousSection

 public function findPreviousSection($order)
 {
     if ($order === null) {
         return null;
     }
     $example = new OW_Example();
     $example->andFieldGreaterThan('sortOrder', (int) $order);
     return $this->findObjectByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:9,代码来源:question_section_dao.php

示例8: findUserCretedEventsCount

 public function findUserCretedEventsCount($userId)
 {
     $example = new OW_Example();
     $example->andFieldEqual(self::USER_ID, $userId);
     $example->andFieldGreaterThan(self::START_TIME_STAMP, time());
     return $this->countByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:event_dao.php

示例9: findNewInvitationList

 public function findNewInvitationList($userId, $afterStamp = null)
 {
     $example = new OW_Example();
     $example->andFieldEqual('userId', $userId);
     $example->andFieldEqual('viewed', false);
     if ($afterStamp) {
         $example->andFieldGreaterThan('timeStamp', $afterStamp);
     }
     $example->setOrder('timeStamp DESC');
     return $this->findListByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:11,代码来源:invitation_dao.php

示例10: deleteExpiredEntities

 public function deleteExpiredEntities()
 {
     $example = new OW_Example();
     $example->andFieldGreaterThan(self::EXPIRATION_TS, time());
     $this->deleteByExample($example);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:6,代码来源:user_reset_password_dao.php

示例11: processScheduler

 public static function processScheduler($scheduler, $user_aid = null, $limit = 10, $sendNotification = false, $sendActivity = true)
 {
     //register_shutdown_function(array('Ynmediaimporter','handleShutdown'), $scheduler -> id);
     //ini_set('max_execution_time',1);
     $movedCount = 0;
     $movedArray = array();
     $photos = array();
     $schedulerId = $scheduler->id;
     $userId = $scheduler->user_id;
     $user = BOL_UserService::getInstance()->findUserById($userId);
     $album = null;
     $example = new OW_Example();
     $example->andFieldEqual('scheduler_id', $schedulerId);
     $example->andFieldLessThan('status', '3');
     $example->andFieldGreaterThan('status', '0');
     $example->setLimitClause(0, $limit);
     if ($user_aid) {
         $example->andFieldEqual('user_aid', intval($user_aid));
     }
     $nodeList = YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->findListByExample($example);
     $order = 0;
     foreach ($nodeList as $node) {
         if ('photo' == $node->media && $node->user_aid > 0) {
             $album = PHOTO_BOL_PhotoAlbumDao::getInstance()->findById($node->user_aid);
             if (!is_object($album)) {
                 continue;
             }
             //download file
             $dir = Ynmediaimporter::getValidDir();
             $file = $dir . $node->getUUID();
             $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $album->userId, 'action' => 'photo_view_album'));
             $photo = new PHOTO_BOL_Photo();
             $photo->description = '';
             $photo->albumId = $album->id;
             $photo->addDatetime = time();
             $photo->status = 'approved';
             $photo->hasFullsize = '1';
             $photo->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
             $source = self::saveImageFromUrl($node->getDownloadFilename(), $file);
             $photo = self::__savePhoto($photo, $source, $userId);
             if ($photo) {
                 $photos[] = $photo;
                 $movedArray[] = array('addTimestamp' => time(), 'photoId' => $photo->id);
                 $movedCount++;
             }
             $node->status = 3;
             YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->save($node);
         } else {
             if (in_array($node->media, array('album', 'photoset', 'gallery')) && 0 == $node->user_aid) {
                 // create new albums for this roles
                 $album = self::createPhotoAlbums($scheduler, $node);
                 // setup album and node.
                 // update all sub node of current scheduler to this albums.
                 $example = new OW_Example();
                 $example->andFieldEqual('scheduler_id', $schedulerId);
                 $example->andFieldEqual('aid', $node->aid);
                 $nodeTemp = YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->findObjectByExample($example);
                 $nodeTemp->user_aid = $album->id;
                 $nodeTemp->status = '1';
                 YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->save($nodeTemp);
                 $node->user_aid = $album->id;
                 $node->status = 1;
                 YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->save($node);
                 self::processScheduler($scheduler, $album->id, 10, 0, 0);
                 break;
                 // force process this album to escape no value style.
             }
         }
     }
     $example = new OW_Example();
     $example->andFieldEqual('scheduler_id', $schedulerId);
     $example->andFieldEqual('media', 'photo');
     $example->andFieldLessThan('status', '3');
     $remain = intval(YNMEDIAIMPORTER_BOL_NodeDao::getInstance()->countByExample($example));
     // all scheduler is completed. send notification to users
     if (is_object($album) && $remain == 0) {
         // Send notification
         if ($sendNotification) {
             $actor = array('username' => BOL_UserService::getInstance()->getUserName($userId), 'name' => BOL_UserService::getInstance()->getDisplayName($userId), 'url' => BOL_UserService::getInstance()->getUserUrl($userId));
             $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId));
             $event = new OW_Event('notifications.add', array('pluginKey' => 'ynmediaimporter', 'entityType' => 'ynmediaimporter_album', 'entityId' => (int) $album->id, 'action' => 'ynmediaimporter_album-added', 'userId' => $album->userId, 'time' => time()), array('avatar' => $avatars[$userId], 'string' => array('key' => 'ynmediaimporter+added_album_notification_string', 'vars' => array('actor' => $actor['name'], 'actorUrl' => $actor['url'], 'title' => $album->name, 'url' => OW::getRouter()->urlForRoute('photo_user_album', array('user' => $actor['username'], 'album' => $album->id)))), 'content' => $album->name, 'url' => OW::getRouter()->urlForRoute('photo_user_album', array('user' => $actor['username'], 'album' => $album->id))));
             OW::getEventManager()->trigger($event);
         }
         if ($sendActivity) {
             self::__sendActivity($album, $photos, $movedArray, $movedCount);
         }
     }
     $scheduler->status = $remain == 0 ? 3 : 1;
     $scheduler->last_run = time();
     YNMEDIAIMPORTER_BOL_SchedulerDao::getInstance()->save($scheduler);
     // and of process rec count all
     $tableName = OW_DB_PREFIX . 'ynmediaimporter_nodes';
     $sql = "SELECT\n\t\t\t\t  album.id,\n\t\t\t\t  (SELECT\n\t\t\t\t     COUNT( * )\n\t\t\t\t   FROM {$tableName} AS photo\n\t\t\t\t   WHERE photo.media = 'photo'\n\t\t\t\t       AND photo.aid = album.id\n\t\t\t\t       AND photo.status = 1) AS remaining\n\t\t\t\tFROM `{$tableName}` album\n\t\t\t\tWHERE album.media <> 'photo'\n\t\t\t\t    AND album.status = 1\n\t\t\t\tGROUP BY album.id\n\t\t\t\tHAVING remaining = 0";
     $completedList = OW::getDbo()->queryForColumnList($sql);
     if ($completedList) {
         $sql = "UPDATE `{$tableName}` SET `status` = '3' where `id` IN (" . implode(',', $completedList) . ")";
         OW::getDbo()->query($sql);
     }
     return array('remain' => $remain, 'scheduler_id' => $schedulerId);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:100,代码来源:Service.php


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