} elseif (isset($_GET['start_date']) && !empty($_GET['end_date'])) { $start_date = local_strtotime($_GET['start_date']); $end_date = local_strtotime($_GET['end_date']); } else { $today = local_strtotime(local_date('Y-m-d')); $start_date = $today - 86400 * 7; $end_date = $today; } /*------------------------------------------------------ */ //--商品明细列表 /*------------------------------------------------------ */ if ($_REQUEST['act'] == 'list') { $account = $money_list = array(); $account['voucher_amount'] = get_total_amount($start_date, $end_date); //充值总额 $account['to_cash_amount'] = get_total_amount($start_date, $end_date, 1); //提现总额 $sql = " SELECT IFNULL(SUM(user_money), 0) AS user_money, IFNULL(SUM(frozen_money), 0) AS frozen_money FROM " . $ecs->table('account_log') . " WHERE `change_time` >= " . $start_date . " AND `change_time` < " . ($end_date + 86400); $money_list = $db->getRow($sql); $account['user_money'] = price_format($money_list['user_money']); //用户可用余额 $account['frozen_money'] = price_format($money_list['frozen_money']); //用户冻结金额 $sql = "SELECT IFNULL(SUM(surplus), 0) AS surplus, IFNULL(SUM(integral_money), 0) AS integral_money FROM " . $ecs->table('order_info') . " WHERE 1 AND `add_time` >= " . $start_date . " AND `add_time` < " . ($end_date + 86400); $money_list = $db->getRow($sql); $account['surplus'] = price_format($money_list['surplus']); //交易使用余额 $account['integral_money'] = price_format($money_list['integral_money']); //积分使用余额 /* 赋值到模板 */ $smarty->assign('account', $account);
$GLOBALS['smarty']->assign('admin_agency_id', $admin_agency_id); $action_list = if_agency() ? 'all' : ''; $GLOBALS['smarty']->assign('all', $action_list); if (!empty($admin_agency_id) && if_agency()) { if ($admin_agency_id != '-') { $where .= " AND u.top_rank = '{$admin_agency_id}' "; $agency_where .= " AND admin_agency_id = '{$admin_agency_id}' "; } } elseif (if_agency()) { $where .= " AND u.top_rank = '0' "; $agency_where .= " AND admin_agency_id = '0' "; } $account = $money_list = array(); $account['voucher_amount'] = get_total_amount($start_date, $end_date, '0', $admin_agency_id); //充值总额 $account['to_cash_amount'] = get_total_amount($start_date, $end_date, 1, $admin_agency_id); //提现总额 $sql = " SELECT IFNULL(SUM(a.user_money), 0) AS user_money, IFNULL(SUM(a.frozen_money), 0) AS frozen_money FROM " . $ecs->table('account_log') . "As a left join " . $ecs->table('users') . "As u on a.user_id = u.user_id WHERE `change_time` >= " . $start_date . " AND `change_time` < " . ($end_date + 86400) . " {$where}"; $money_list = $db->getRow($sql); $account['user_money'] = price_format($money_list['user_money']); //用户可用余额 $account['frozen_money'] = price_format($money_list['frozen_money']); //用户冻结金额 $sql = "SELECT IFNULL(SUM(surplus), 0) AS surplus, IFNULL(SUM(integral_money), 0) AS integral_money FROM " . $ecs->table('order_info') . " WHERE 1 AND `add_time` >= " . $start_date . " AND `add_time` < " . ($end_date + 86400) . " {$agency_where}"; $money_list = $db->getRow($sql); $account['surplus'] = price_format($money_list['surplus']); //交易使用余额 $account['integral_money'] = price_format($money_list['integral_money']); //积分使用余额 /* 赋值到模板 */ $smarty->assign('account', $account);