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


PHP tools::isPeakNow方法代码示例

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


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

示例1: define

<?php

define('_DIR_', dirname(__FILE__));
require_once 'config/db.php';
require_once 'config/settings.inc.php';
require_once 'app/core/tools.class.php';
require_once 'app/core/database.class.php';
require_once 'daemons_functions.php';
date_default_timezone_set($settings['app']['timezone']);
session_start();
if (!empty($_SESSION['user_id'])) {
    $data['user_id'] = $_SESSION['user_id'];
} else {
    $data['user_id'] = null;
}
if (!empty($_GET['id'])) {
    $data['auction_id'] = htmlspecialchars($_GET['id'], ENT_QUOTES, 'UTF-8');
    $data['time_increment'] = get('time_increment', $data['auction_id'], 0);
    $data['bid_debit'] = get('bid_debit', $data['auction_id'], 0);
    $data['price_increment'] = get('price_increment', $data['auction_id'], 0);
}
$data['isPeakNow'] = tools::isPeakNow();
// bid the auction
$auction = bid($data);
开发者ID:7s4r,项目名称:eBidix,代码行数:24,代码来源:bid.php

示例2: define

<?php

define('_DIR_', dirname(__FILE__));
require_once _DIR_ . '/config/settings.inc.php';
require_once _DIR_ . '/config/db.php';
require_once _DIR_ . '/app/core/database.class.php';
require_once _DIR_ . '/app/core/tools.class.php';
require_once _DIR_ . '/app/libs/fastjson/fastjson.php';
session_start();
if (!empty($_SESSION['user_id'])) {
    $user_id = $_SESSION['user_id'];
} else {
    $user_id = null;
}
date_default_timezone_set($settings['app']['timezone']);
$isPeakNow = tools::isPeakNow();
$site_online = tools::siteOnline();
$data = $_POST;
if (empty($data)) {
    die('No data given');
}
$results = array();
foreach ($data as $key => $value) {
    if (!empty($_GET['histories'])) {
        $result = tools::readCache('auction_view_' . $value);
    } else {
        $result = tools::readCache('auction_' . $value);
    }
    if (empty($result)) {
        $db = database::getInstance();
        // gettting data
开发者ID:7s4r,项目名称:eBidix,代码行数:31,代码来源:getstatus.php

示例3: microtime

 if (tools::readCache('close.pid')) {
     return false;
 } else {
     tools::writeCache('close.pid', microtime(), 50);
 }
 $db = database::getInstance();
 $isPeakNow = tools::isPeakNow();
 $expireTime = time() + 60;
 while (time() < $expireTime) {
     $sql = "SELECT id, peak_only, end_time FROM " . DB_PREFIX . "auctions WHERE end_time <= '" . date('Y-m-d H:i:s') . "' AND closed=0 AND active=1 AND status_id=3";
     if ($res = $db->getRows($sql)) {
         if (sizeof($res) > 0) {
             foreach ($res as $auction) {
                 if (checkCanClose($auction['id'], $isPeakNow) == false) {
                     if ($auction['peak_only'] == 1 && !$isPeakNow) {
                         $peak = tools::isPeakNow(true);
                         if (strtotime($peak['peak_start']) < time()) {
                             $peak['peak_start'] = date('Y-m-d H:i:s', strtotime($peak['peak_start']) + 86400);
                         }
                         $seconds_after_peak = strtotime($auction['end_time']) - strtotime($peak['peak_end']);
                         $time = strtotime($peak['peak_start']) + $seconds_after_peak;
                         $endTime = date('Y-m-d H:i:s', $time);
                         if (strtotime($endTime) < time()) {
                             $endTime = date('Y-m-d H:i:s', strtotime($endTime) + 86400);
                         }
                         $db->update('auctions', "end_time = '{$endTime}'", "id = {$auction['id']}");
                     } else {
                         $data['auction_peak_start'] = get('auction_peak_start');
                         $data['auction_peak_end'] = get('auction_peak_end');
                         $data['isPeakNow'] = $isPeakNow;
                         $data['time_increment'] = get('time_increment', $auction['id'], 0);
开发者ID:7s4r,项目名称:eBidix,代码行数:31,代码来源:daemons.php


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