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


PHP auction_info函数代码示例

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


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

示例1: array

    if ($is_add) {
        $links = array(array('href' => 'auction.php?act=add', 'text' => $_LANG['continue_add_auction']), array('href' => 'auction.php?act=list', 'text' => $_LANG['back_auction_list']));
        sys_msg($_LANG['add_auction_ok'], 0, $links);
    } else {
        $links = array(array('href' => 'auction.php?act=list&' . list_link_postfix(), 'text' => $_LANG['back_auction_list']));
        sys_msg($_LANG['edit_auction_ok'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'settle_money') {
    /* 检查权限 */
    admin_priv('auction');
    /* 检查参数 */
    if (empty($_POST['id'])) {
        sys_msg('invalid param');
    }
    $id = intval($_POST['id']);
    $auction = auction_info($id);
    if (empty($auction)) {
        sys_msg($_LANG['auction_not_exist']);
    }
    if ($auction['status_no'] != FINISHED) {
        sys_msg($_LANG['invalid_status']);
    }
    if ($auction['deposit'] <= 0) {
        sys_msg($_LANG['no_deposit']);
    }
    /* 处理保证金 */
    $exc->edit("is_finished = 2", $id);
    // 修改状态
    if (isset($_POST['unfreeze'])) {
        /* 解冻 */
        log_account_change($auction['last_bid']['bid_user'], $auction['deposit'], -1 * $auction['deposit'], 0, 0, sprintf($_LANG['unfreeze_auction_deposit'], $auction['act_name']));
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:auction.php

示例2: get_user_prompt

/**
 *  获取用户参与活动信息.
 *
 * @param int $user_id 用户id
 *
 * @return array
 */
function get_user_prompt($user_id)
{
    $prompt = array();
    $now = gmtime();
    /* 夺宝奇兵 */
    $sql = 'SELECT act_id, goods_name, end_time ' . 'FROM ' . $GLOBALS['ecs']->table('goods_activity') . " WHERE act_type = '" . GAT_SNATCH . "'" . " AND (is_finished = 1 OR (is_finished = 0 AND end_time <= '{$now}'))";
    $res = $GLOBALS['db']->query($sql);
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $act_id = $row['act_id'];
        $result = get_snatch_result($act_id);
        if (isset($result['order_count']) && $result['order_count'] == 0 && $result['user_id'] == $user_id) {
            $prompt[] = array('text' => sprintf($GLOBALS['_LANG']['your_snatch'], $row['goods_name'], $row['act_id']), 'add_time' => $row['end_time']);
        }
        if (isset($auction['last_bid']) && $auction['last_bid']['bid_user'] == $user_id && $auction['order_count'] == 0) {
            $prompt[] = array('text' => sprintf($GLOBALS['_LANG']['your_auction'], $row['goods_name'], $row['act_id']), 'add_time' => $row['end_time']);
        }
    }
    /* 竞拍 */
    $sql = 'SELECT act_id, goods_name, end_time ' . 'FROM ' . $GLOBALS['ecs']->table('goods_activity') . " WHERE act_type = '" . GAT_AUCTION . "'" . " AND (is_finished = 1 OR (is_finished = 0 AND end_time <= '{$now}'))";
    $res = $GLOBALS['db']->query($sql);
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $act_id = $row['act_id'];
        $auction = auction_info($act_id);
        if (isset($auction['last_bid']) && $auction['last_bid']['bid_user'] == $user_id && $auction['order_count'] == 0) {
            $prompt[] = array('text' => sprintf($GLOBALS['_LANG']['your_auction'], $row['goods_name'], $row['act_id']), 'add_time' => $row['end_time']);
        }
    }
    /* 排序 */
    $cmp = create_function('$a, $b', 'if($a["add_time"] == $b["add_time"]){return 0;};return $a["add_time"] < $b["add_time"] ? 1 : -1;');
    usort($prompt, $cmp);
    /* 格式化时间 */
    foreach ($prompt as $key => $val) {
        $prompt[$key]['formated_time'] = local_date($GLOBALS['_CFG']['time_format'], $val['add_time']);
    }
    return $prompt;
}
开发者ID:netroby,项目名称:ecshop,代码行数:43,代码来源:lib_clips.php


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