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


PHP get_user_bonus函数代码示例

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


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

示例1: get_user_info

/**
 *  获取用户信息数组
 *
 * @access  public
 * @param
 *
 * @return array        $user       用户信息数组
 */
function get_user_info($id = 0)
{
    if ($id == 0) {
        $id = $_SESSION['user_id'];
    }
    $time = date('d-m-Y');
    $sql = 'SELECT u.user_id, u.email, u.user_name, u.user_money, u.pay_points' . ' FROM ' . $GLOBALS['ecs']->table('users') . ' AS u ' . " WHERE u.user_id = '{$id}'";
    $user = $GLOBALS['db']->getRow($sql);
    $bonus = get_user_bonus($id);
    $user['username'] = $user['user_name'];
    $user['user_points'] = $user['pay_points'] . $GLOBALS['_CFG']['integral_name'];
    $user['user_money'] = price_format($user['user_money'], false);
    $user['user_bonus'] = price_format($bonus['bonus_value'], false);
    return $user;
}
开发者ID:duynhan07,项目名称:ecshop-vietnam,代码行数:23,代码来源:lib_main.php

示例2: get_user_default

/**
 * 获取用户中心默认页面所需的数据.
 *
 * @param int $user_id 用户ID
 *
 * @return array $info               默认页面所需资料数组
 */
function get_user_default($user_id)
{
    $user_bonus = get_user_bonus();
    $sql = 'SELECT pay_points, user_money, credit_line, last_login, is_validated FROM ' . $GLOBALS['ecs']->table('users') . " WHERE user_id = '{$user_id}'";
    $row = $GLOBALS['db']->getRow($sql);
    $info = array();
    $info['username'] = stripslashes($_SESSION['user_name']);
    $info['shop_name'] = $GLOBALS['_CFG']['shop_name'];
    $info['integral'] = $row['pay_points'] . $GLOBALS['_CFG']['integral_name'];
    /* 增加是否开启会员邮件验证开关 */
    $info['is_validate'] = $GLOBALS['_CFG']['member_email_validate'] && !$row['is_validated'] ? 0 : 1;
    $info['credit_line'] = $row['credit_line'];
    $info['formated_credit_line'] = price_format($info['credit_line'], false);
    //如果$_SESSION中时间无效说明用户是第一次登录。取当前登录时间。
    $last_time = !isset($_SESSION['last_time']) ? $row['last_login'] : $_SESSION['last_time'];
    if ($last_time == 0) {
        $_SESSION['last_time'] = $last_time = gmtime();
    }
    $info['last_time'] = local_date($GLOBALS['_CFG']['time_format'], $last_time);
    $info['surplus'] = price_format($row['user_money'], false);
    $info['bonus'] = sprintf($GLOBALS['_LANG']['user_bonus_info'], $user_bonus['bonus_count'], price_format($user_bonus['bonus_value'], false));
    $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = '" . $user_id . "' AND add_time > '" . local_strtotime('-1 months') . "'";
    $info['order_count'] = $GLOBALS['db']->getOne($sql);
    include_once ROOT_PATH . 'includes/lib_order.php';
    $sql = 'SELECT order_id, order_sn ' . ' FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = '" . $user_id . "' AND shipping_time > '" . $last_time . "'" . order_query_sql('shipped');
    $info['shipped_order'] = $GLOBALS['db']->getAll($sql);
    return $info;
}
开发者ID:netroby,项目名称:ecshop,代码行数:35,代码来源:lib_clips.php

示例3: get_user_default

/**
 * 获取用户中心默认页面所需的数据
 *
 * @access  public
 * @param   int         $user_id            用户ID
 *
 * @return  array       $info               默认页面所需资料数组
 */
function get_user_default($user_id)
{
    $user_bonus = get_user_bonus();
    $paystatus = PS_PAYED;
    $sql = "SELECT pay_points, user_money, head_img, credit_line, last_login, is_validated, phonestatus, emailstatus, idcardstatus, bangcardstatus FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id = '{$user_id}'";
    $row = $GLOBALS['db']->getRow($sql);
    $info = array();
    $info['username'] = stripslashes($_SESSION['user_name']);
    $info['shop_name'] = $GLOBALS['_CFG']['shop_name'];
    $info['integral'] = $row['pay_points'] . $GLOBALS['_CFG']['integral_name'];
    $info['phonestatus'] = $row['phonestatus'];
    $info['emailstatus'] = $row['emailstatus'];
    $info['idcardstatus'] = $row['idcardstatus'];
    $info['bangcardstatus'] = $row['bangcardstatus'];
    $info['user_head_img'] = empty($row['head_img']) ? '0' : $row['head_img'];
    /* 增加是否开启会员邮件验证开关 */
    $info['is_validate'] = $GLOBALS['_CFG']['member_email_validate'] && !$row['is_validated'] ? 0 : 1;
    $info['credit_line'] = $row['credit_line'];
    $info['formated_credit_line'] = price_format($info['credit_line'], false);
    //如果$_SESSION中时间无效说明用户是第一次登录。取当前登录时间。
    $last_time = !isset($_SESSION['last_time']) ? $row['last_login'] : $_SESSION['last_time'];
    if ($last_time == 0) {
        $_SESSION['last_time'] = $last_time = gmtime();
    }
    $info['last_time'] = local_date($GLOBALS['_CFG']['time_format'], $last_time);
    $info['surplus'] = price_format($row['user_money'], false);
    $info['frozen'] = price_format($row['frozen_money'], false);
    $info['bonus'] = sprintf($GLOBALS['_LANG']['user_bonus_info'], $user_bonus['bonus_count'], price_format($user_bonus['bonus_value'], false));
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_goods') . " WHERE user_id = '" . $user_id . "' AND add_time > '" . local_strtotime('-1 months') . "'";
    $info['order_count'] = $GLOBALS['db']->getOne($sql);
    /* 理财资产*/
    $sqlsum = "SELECT SUM(invest_price) FROM " . $GLOBALS['ecs']->table('order_goods') . " where pay_status =" . $paystatus . " and user_id =" . $user_id;
    $info['order_sum'] = $GLOBALS['db']->getOne($sqlsum);
    $info['order_sum'] = empty($info['order_sum']) ? '0.00' : $info['order_sum'];
    /* 借款负债*/
    //$sqlborrow = "SELECT SUM(borrow_num) FROM ".$GLOBALS['ecs']->table('user_borrow')." where borrow_status = 1 and user_id =".$user_id;
    //$info['borrow_sum'] = $GLOBALS['db']->getOne($sqlborrow);
    //$info['borrow_sum'] = empty($info['borrow_sum'])?'0.00':$info['borrow_sum'];
    /* 账户净资产*/
    $info['account_sum'] = $info['order_sum'] - $info['borrow_sum'] + $info['surplus'];
    $info['account_sum'] = empty($info['account_sum']) ? '0.00' : $info['account_sum'];
    include_once ROOT_PATH . 'includes/lib_order.php';
    $sql = "SELECT order_id, order_sn " . " FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = '" . $user_id . "' AND shipping_time > '" . $last_time . "'" . order_query_sql('shipped');
    $info['shipped_order'] = $GLOBALS['db']->getAll($sql);
    return $info;
}
开发者ID:blowfishJ,项目名称:galaxyCode,代码行数:54,代码来源:lib_clips.php

示例4: get_user_info

/**
 *  获取用户信息数组
 *
 * @access  public
 * @param
 *
 * @return array        $user       用户信息数组
 */
function get_user_info($id = 0)
{
    if ($id == 0) {
        $id = $_SESSION['user_id'];
    }
    $time = date('Y-m-d');
    $user = M('users')->field(array('user_id', 'email', 'user_name', 'user_money', 'pay_points'))->where(array('user_id' => $id))->find();
    $bonus = get_user_bonus($id);
    $user['username'] = $user['user_name'];
    $user['user_points'] = $user['pay_points'] . $GLOBALS['_CFG']['integral_name'];
    $user['user_money'] = price_format($user['user_money'], false);
    $user['user_bonus'] = price_format($bonus['bonus_value'], false);
    return $user;
}
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:22,代码来源:function.php

示例5: get_user_default

/**
 * 获取用户中心默认页面所需的数据
 *
 * @access  public
 * @param   int         $user_id            用户ID
 *
 * @return  array       $info               默认页面所需资料数组
 */
function get_user_default($user_id)
{
    $user_bonus = get_user_bonus();
    $sql = "SELECT pay_points, user_money, credit_line, last_login, is_validated, mobile_phone FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id = '{$user_id}'";
    $info = $GLOBALS['db']->getRow($sql);
    //$info = array();
    $info['username'] = stripslashes($_SESSION['user_name']);
    $info['shop_name'] = $GLOBALS['_CFG']['shop_name'];
    $info['integral'] = $info['pay_points'];
    //不显示"积分" by wang
    /* 增加是否开启会员邮件验证开关 */
    //$info['is_validate'] = ($GLOBALS['_CFG']['member_email_validate'] && !$row['is_validated'])?0:1;
    //$info['credit_line'] = $row['credit_line'];
    $info['formated_credit_line'] = price_format($info['credit_line'], false);
    //如果$_SESSION中时间无效说明用户是第一次登录。取当前登录时间。
    $last_time = !isset($_SESSION['last_time']) ? $info['last_login'] : $_SESSION['last_time'];
    if ($last_time == 0) {
        $_SESSION['last_time'] = $last_time = gmtime();
    }
    $info['last_time'] = local_date($GLOBALS['_CFG']['time_format'], $last_time);
    $info['surplus'] = $info['user_money'];
    //不显示价格格式 by wang
    $info['bonus'] = $user_bonus['bonus_count'];
    //不是红包格式 //by wang
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = {$user_id} AND order_status = " . OS_CONFIRMED . " AND shipping_status != " . SS_RECEIVED;
    $info['order_count'] = $GLOBALS['db']->getOne($sql);
    /*include_once(ROOT_PATH . 'include/lib_order.php');
      $sql = "SELECT order_id, order_sn ".
              " FROM " .$GLOBALS['ecs']->table('order_info').
              " WHERE user_id = '" .$user_id. "' AND shipping_time > '" .$last_time. "'". order_query_sql('shipped');
      $info['shipped_order'] = $GLOBALS['db']->getAll($sql);*/
    return $info;
}
开发者ID:GYWang1983,项目名称:fruit,代码行数:41,代码来源:lib_clips.php


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