$tip .= "积分+" . format_score(app_conf("USER_LOGIN_KEEP_SCORE")); } if (intval(app_conf("USER_LOGIN_KEEP_POINT")) > 0) { $tip .= "经验+" . app_conf("USER_LOGIN_KEEP_POINT"); } $GLOBALS['tmpl']->assign("sign_tip", $tip); } else { if (!$y_sign_data) { $GLOBALS['db']->query("delete from " . DB_PREFIX . "user_sign_log where user_id = " . $user_id); } $tip = ""; if (doubleval(app_conf("USER_LOGIN_MONEY")) > 0) { $tip .= "资金+" . format_price(app_conf("USER_LOGIN_MONEY")); } if (intval(app_conf("USER_LOGIN_SCORE")) > 0) { $tip .= "积分+" . format_score(app_conf("USER_LOGIN_SCORE")); } if (intval(app_conf("USER_LOGIN_POINT")) > 0) { $tip .= "信用+" . app_conf("USER_LOGIN_POINT"); } $GLOBALS['tmpl']->assign("sign_tip", $tip); } $GLOBALS['tmpl']->assign("sign_day", $total_signcount); $GLOBALS['tmpl']->assign("y_sign_data", $y_sign_data); } } else { if ($_REQUEST['ajax'] == 1) { ajax_return(array("status" => 0, "info" => "请先登录")); } else { es_session::set('before_login', $_SERVER['REQUEST_URI']); app_redirect(url("index", "user#login"));
function get_op_change_show($m_name, $a_name) { if ($a_name == "replydel" || $a_name == 'del') { //删除 $money = doubleval(app_conf("USER_DELETE_MONEY")); $money_f = "-" . format_price(0 - $money); $score = intval(app_conf("USER_DELETE_SCORE")); $score_f = "-" . format_score(0 - $score); $point = intval(app_conf("USER_DELETE_POINT")); $point_f = "-" . (0 - $point) . "经验"; } else { //增加 $money = doubleval(app_conf("USER_ADD_MONEY")); $money_f = "+" . format_price($money); $score = intval(app_conf("USER_ADD_SCORE")); $score_f = "+" . format_score($score); $point = intval(app_conf("USER_ADD_POINT")); $point_f = "+" . $point . "经验"; } $str = ""; if ($money != 0) { $str .= $money_f; } if ($score != 0) { $str .= $score_f; } if ($point != 0) { $str .= $point_f; } return $str; }
echo addslashes($user["id"]); ?> ')"><?php echo $user["user_name"]; ?> </a></td><td> <?php echo $user["email"]; ?> </td><td> <?php echo $user["mobile"]; ?> </td><td> <?php echo format_price($user["money"]); ?> </td><td> <?php echo format_score($user["score"]); ?> </td><td> <?php echo $user["point"]; ?> </td><td> <?php echo get_user_group($user["group_id"]); ?> </td><td> <?php echo get_user_level($user["level_id"]); ?> </td><td> <?php echo get_referrals_name($user["pid"]); ?> </td><td> <?php echo $user["login_ip"];
$side_message['list'][$k]['url'] = url("tuan", "message#faq") . "#consult-entry-" . $v['id']; $side_message['list'][$k]['content'] = empty_tag($v['content']); } return $side_message; } function get_side_vote() { $now = get_gmtime(); $vote = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote where is_effect = 1 and begin_time < " . $now . " and (end_time = 0 or end_time > " . $now . ") order by sort desc limit 1"); return $vote; } if ($deal) { $side_deal_list = get_side_deal(intval($deal['id'])); $GLOBALS['tmpl']->assign("side_deal_list", $side_deal_list); } //输出返利 if (app_conf("INVITE_REFERRALS_TYPE") == 0) { $referral_tip = sprintf($GLOBALS['lang']['INVITE_REFERRALS_TIP'], format_price(app_conf("INVITE_REFERRALS"))); } else { $referral_tip = sprintf($GLOBALS['lang']['INVITE_REFERRALS_TIP'], format_score(app_conf("INVITE_REFERRALS"))); } $GLOBALS['tmpl']->assign("invite_referrals_tip", $referral_tip); //输出团购讨论 $side_deal_message = get_side_deal_message(intval($deal['id'])); $GLOBALS['tmpl']->assign("side_deal_message", $side_deal_message); //输出问题答疑 $side_message = get_side_message(); $GLOBALS['tmpl']->assign("side_message", $side_message); //商务合作 $deal_cooperation_tip = sprintf($GLOBALS['lang']['DEAL_COOPERATION_TIP'], url("tuan", "message#seller")); $GLOBALS['tmpl']->assign("deal_cooperation_tip", $deal_cooperation_tip);
function getFeeItem($cart_total) { $feeinfo[] = array("item" => "应付总额", "value" => format_price($cart_total['pay_total_price'])); if ($cart_total['return_total_score'] != 0) { if ($cart_total['return_total_score'] > 0) { $score = "增加" . format_score($cart_total['return_total_score']); } else { $score = "消费" . format_score(abs($cart_total['return_total_score'])); } $feeinfo[] = array("item" => "积分变动", "value" => $score); } if ($cart_total['total_price'] > 0) { $feeinfo[] = array("item" => "商品总金额", "value" => format_price($cart_total['total_price'])); } if ($cart_total['delivery_fee'] != 0) { $feeinfo[] = array("item" => "运费", "value" => format_price($cart_total['delivery_fee'])); } if ($cart_total['account_money'] != 0) { $feeinfo[] = array("item" => "余额支付", "value" => format_price($cart_total['account_money'])); } if ($cart_total['ecv_money'] != 0) { $feeinfo[] = array("item" => "代金券支付", "value" => format_price($cart_total['ecv_money'])); } if ($cart_total['paid_account_money'] != 0 || $cart_total['paid_ecv_money'] != 0) { $feeinfo[] = array("item" => "已收金额", "value" => format_price($cart_total['paid_account_money'] + $cart_total['paid_ecv_money'])); } $feeinfo[] = array("item" => "应付金额", "value" => format_price($cart_total['pay_price'])); return $feeinfo; }
public function index() { $type = intval($_REQUEST['type']); $weektime = htmlspecialchars(trim($_REQUEST['weektime'])); $yeartime = intval($_REQUEST['yeartime']); $now = get_gmtime(); if ($weektime == '') { $weektime = to_date($now, "Y-m-d"); } if ($yeartime == 0) { $yeartime = to_date($now, "Y"); } $thisyeartime = to_date($now, "Y"); $this->assign("weektime", $weektime); $this->assign("yeartime", $yeartime); $this->assign("thisyeartime", $thisyeartime); $this->assign("type", $type); $weektimespan = to_timespan($weektime, 'Y-m-d'); $yeartimespan = to_timespan($yeartime, 'Y'); if ($type == 0) { $current_week = to_date($weektimespan, "w"); $statistic_data = array(); $week_col = array(); for ($i = 0; $i < 7; $i++) { $week_col[$i] = array("begin_time" => $weektimespan + ($i - $current_week) * 24 * 3600, "end_time" => $weektimespan + ($i - $current_week) * 24 * 3600 + 24 * 3600 - 1, "week" => l("WEEK_" . $i), "datetime" => to_date($weektimespan + ($i - $current_week) * 24 * 3600, "Y-m-d")); if ($i == $current_week) { $week_col[$i]['current'] = 1; } else { $week_col[$i]['current'] = 0; } } $statistic_col = array('00_register', '01_onsale', '02_ordercount', '03_paidordercount', '04_totalamount', '05_onlinepay', '06_creditpay', '07_scorepay', '08_onlineincharge'); foreach ($statistic_col as $k => $v) { $statistic_data[$k]['name'] = l($v); $statistic_data[$k]['data'] = array(); $total_amount = 0; foreach ($week_col as $kk => $vv) { if ($v == "00_register") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "01_onsale") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0 and ((begin_time between " . $vv['begin_time'] . " and " . $vv['end_time'] . ") or begin_time = 0)"); $statistic_data[$k]['data'][$kk] = intval($count); } if ($v == "02_ordercount") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where is_delete = 0 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "03_paidordercount") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "04_totalamount") { $count = $GLOBALS['db']->getOne("select sum(pay_amount) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "05_onlinepay") { $count = $GLOBALS['db']->getOne("select sum(pay_amount-ecv_money-account_money) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "06_creditpay") { $count = $GLOBALS['db']->getOne("select sum(account_money) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "07_scorepay") { $count = $GLOBALS['db']->getOne("select sum(return_total_score) from " . DB_PREFIX . "deal_order where is_delete = 0 and return_total_score < 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_score(intval(abs($count))); $total_amount += intval(abs($count)); } if ($v == "08_onlineincharge") { $count = $GLOBALS['db']->getOne("select sum(pay_amount) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and type = 1 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } } //总额 if ($v == "01_onsale") { $total_amount = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0 and ((begin_time between " . $week_col[0]['begin_time'] . " and " . $week_col[6]['end_time'] . ") or begin_time = 0)"); $total_amount = $total_amount; } if ($v == "04_totalamount") { $total_amount = format_price($total_amount); } if ($v == "05_onlinepay") { $total_amount = format_price($total_amount); } if ($v == "06_creditpay") { $total_amount = format_price($total_amount); } if ($v == "07_scorepay") { $total_amount = format_score($total_amount); } if ($v == "08_onlineincharge") { $total_amount = format_price($total_amount); } $statistic_data[$k]['data'][count($week_col)] = $total_amount; //总额 } $this->assign("week_col", $week_col); $this->assign("statistic_data", $statistic_data); } else { if ($yeartime == to_date($now, "Y")) { //今年 $current_month = to_date($now, "n"); } else { $current_month = 0; } $statistic_data = array(); $month_col = array(); for ($i = 1; $i <= 12; $i++) { $month_col[$i - 1] = array("begin_time" => to_timespan($yeartime . "-" . str_pad($i, 2, "0", STR_PAD_LEFT) . "-01 00:00:00", "Y-m-d H:i:s"), "end_time" => to_timespan($yeartime . "-" . str_pad($i + 1, 2, "0", STR_PAD_LEFT) . "-01 00:00:00", "Y-m-d H:i:s") - 1, "month" => l("MONTH_" . $i)); if ($i == $current_month) { $month_col[$i - 1]['current'] = 1; } else { $month_col[$i - 1]['current'] = 0; } } $statistic_col = array('00_register', '01_onsale', '02_ordercount', '03_paidordercount', '04_totalamount', '05_onlinepay', '06_creditpay', '07_scorepay', '08_onlineincharge'); foreach ($statistic_col as $k => $v) { $statistic_data[$k]['name'] = l($v); $statistic_data[$k]['data'] = array(); $total_amount = 0; foreach ($month_col as $kk => $vv) { if ($v == "00_register") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "01_onsale") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0 and ((begin_time between " . $vv['begin_time'] . " and " . $vv['end_time'] . ") or begin_time = 0)"); $statistic_data[$k]['data'][$kk] = intval($count); } if ($v == "02_ordercount") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where is_delete = 0 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "03_paidordercount") { $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = intval($count); $total_amount += intval($count); } if ($v == "04_totalamount") { $count = $GLOBALS['db']->getOne("select sum(pay_amount) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "05_onlinepay") { $count = $GLOBALS['db']->getOne("select sum(pay_amount-ecv_money-account_money) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "06_creditpay") { $count = $GLOBALS['db']->getOne("select sum(account_money) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } if ($v == "07_scorepay") { $count = $GLOBALS['db']->getOne("select sum(return_total_score) from " . DB_PREFIX . "deal_order where is_delete = 0 and return_total_score < 0 and pay_status = 2 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_score(intval(abs($count))); $total_amount += intval(abs($count)); } if ($v == "08_onlineincharge") { $count = $GLOBALS['db']->getOne("select sum(pay_amount) from " . DB_PREFIX . "deal_order where is_delete = 0 and pay_status = 2 and type = 1 and create_time between " . $vv['begin_time'] . " and " . $vv['end_time']); $statistic_data[$k]['data'][$kk] = format_price(doubleval($count)); $total_amount += doubleval($count); } } //总额 if ($v == "01_onsale") { $total_amount = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0 and ((begin_time between " . $month_col[0]['begin_time'] . " and " . $month_col[11]['end_time'] . ") or begin_time = 0)"); } if ($v == "04_totalamount") { $total_amount = format_price($total_amount); } if ($v == "05_onlinepay") { $total_amount = format_price($total_amount); } if ($v == "06_creditpay") { $total_amount = format_price($total_amount); } if ($v == "07_scorepay") { $total_amount = format_score($total_amount); } if ($v == "08_onlineincharge") { $total_amount = format_price($total_amount); } $statistic_data[$k]['data'][count($month_col)] = $total_amount; //总额 } $this->assign("month_col", $month_col); $this->assign("statistic_data", $statistic_data); } $this->display(); }
/** * 会员中心左侧菜单 */ function assign_uc_nav_list() { $nav_list = (require APP_ROOT_PATH . "system/web_cfg/" . APP_TYPE . "/ucnode_cfg.php"); foreach ($nav_list as $k => $v) { foreach ($v['node'] as $kk => $vv) { if ($vv['module'] == MODULE_NAME) { $nav_list[$k]['node'][$kk]['current'] = 1; } $module_name = $vv['module']; $action_name = $vv['action']; $nav_list[$k]['node'][$kk]['url'] = url("index", $module_name . "#" . $action_name); } } //用户信息 if ($GLOBALS['user_info']) { $user_id = intval($GLOBALS['user_info']['id']); $c_user_info = $GLOBALS['user_info']; $c_user_info['user_group'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "user_group where id = " . intval($GLOBALS['user_info']['group_id'])); $GLOBALS['tmpl']->assign("user_info", $c_user_info); //签到数据 $t_begin_time = to_timespan(to_date(get_gmtime(), "Y-m-d")); //今天开始 $t_end_time = to_timespan(to_date(get_gmtime(), "Y-m-d")) + (24 * 3600 - 1); //今天结束 $y_begin_time = $t_begin_time - 24 * 3600; //昨天开始 $y_end_time = $t_end_time - 24 * 3600; //昨天结束 $t_sign_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_sign_log where user_id = " . $user_id . " and sign_date between " . $t_begin_time . " and " . $t_end_time); if ($t_sign_data) { $GLOBALS['tmpl']->assign("t_sign_data", $t_sign_data); } else { $y_sign_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_sign_log where user_id = " . $user_id . " and sign_date between " . $y_begin_time . " and " . $y_end_time); $total_signcount = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_sign_log where user_id = " . $user_id); if ($y_sign_data && $total_signcount >= 3) { $tip = ""; if (doubleval(app_conf("USER_LOGIN_KEEP_MONEY")) > 0) { $tip .= "资金+" . format_price(app_conf("USER_LOGIN_KEEP_MONEY")); } if (intval(app_conf("USER_LOGIN_KEEP_SCORE")) > 0) { $tip .= "积分+" . format_score(app_conf("USER_LOGIN_KEEP_SCORE")); } if (intval(app_conf("USER_LOGIN_KEEP_POINT")) > 0) { $tip .= "经验+" . app_conf("USER_LOGIN_KEEP_POINT"); } $GLOBALS['tmpl']->assign("sign_tip", $tip); } else { if (!$y_sign_data) { $GLOBALS['db']->query("delete from " . DB_PREFIX . "user_sign_log where user_id = " . $user_id); } $tip = ""; if (doubleval(app_conf("USER_LOGIN_MONEY")) > 0) { $tip .= "资金+" . format_price(app_conf("USER_LOGIN_MONEY")); } if (intval(app_conf("USER_LOGIN_SCORE")) > 0) { $tip .= "积分+" . format_score(app_conf("USER_LOGIN_SCORE")); } if (intval(app_conf("USER_LOGIN_POINT")) > 0) { $tip .= "经验+" . app_conf("USER_LOGIN_POINT"); } $GLOBALS['tmpl']->assign("sign_tip", $tip); } $GLOBALS['tmpl']->assign("sign_day", $total_signcount); $GLOBALS['tmpl']->assign("y_sign_data", $y_sign_data); } } $GLOBALS['tmpl']->assign("uc_nav_list", $nav_list); }