コード例 #1
0
ファイル: query-user.php プロジェクト: aspirin/wp-xintaoke
function xt_update_user_account_cost_counts($user_id, $cash = true, $jifen = true)
{
    if ($cash) {
        $tixians = xt_total_tixian($user_id);
        xt_update_user_count($user_id, XT_USER_COUNT_CASH_COST, $tixians[0] + $tixians[1]);
    }
    if ($jifen) {
        $jifenOrder = xt_user_total_jifen_order($user_id);
        xt_update_user_count($user_id, XT_USER_COUNT_JIFEN_COST, $jifenOrder[0] + $jifenOrder[1]);
    }
}
コード例 #2
0
function _xt_report_fanxian_save($cash, $jifen, $buyer_id, $buyer_name, $sharer_id, $sharer_name, $adser_id, $adser_name, $type, $platform, $trade_id, $commission, $pay_time)
{
    $user_id = 0;
    $user_name = '';
    switch ($type) {
        case 'BUY':
            $user_id = $buyer_id;
            $user_name = $buyer_name;
            break;
        case 'SHARE':
            $user_id = $sharer_id;
            $user_name = $sharer_name;
            break;
        case 'ADS':
            $user_id = $adser_id;
            $user_name = $adser_name;
            break;
    }
    if ($user_id > 0 && ($cash > 0 || $jifen > 0)) {
        if (xt_new_fanxian(array('platform' => $platform, 'trade_id' => $trade_id, 'type' => $type, 'user_id' => $user_id, 'user_name' => $user_name, 'buy_user_id' => $buyer_id, 'buy_user_name' => $buyer_name, 'share_user_id' => $sharer_id, 'share_user_name' => $sharer_name, 'ads_user_id' => $adser_id, 'ads_user_name' => $adser_name, 'commission' => $commission, 'fanxian' => $cash, 'jifen' => $jifen, 'create_time' => current_time('mysql'), 'order_time' => $pay_time))) {
            if (!xt_fanxian_is_pendingtixian() && xt_fanxian_is_autocash()) {
                //处理现金提现,集分宝提现
                $_cash = 0;
                if ($cash > 0) {
                    $_fanxian = xt_user_total_fanxian($user_id);
                    $_tixians = xt_total_tixian($user_id);
                    $_tixian = $_tixians[0] + $_tixians[1];
                    //未审核,已完成
                    $_cash = $_fanxian - $_tixian;
                    //余额
                }
                if ($_cash == 0 && $jifen > 0) {
                    $_fanxian = xt_user_total_jifen($user_id);
                    $_tixians = xt_total_tixian_jifen($user_id);
                    $_tixian = $_tixians[0] + $_tixians[1];
                    //未审核,已完成
                    $_cash = $_fanxian - $_tixian;
                    //余额
                }
                if ($_cash > 0) {
                    xt_new_tixian(array('user_id' => $user_id, 'cash' => $cash, 'jifen' => $jifen));
                }
            }
        }
    }
}
コード例 #3
0
ファイル: ajax.function.php プロジェクト: aspirin/wp-xintaoke
function xt_ajax_tixian_save()
{
    $result = array('code' => 0, 'msg' => '', 'result' => array());
    if (!xt_is_fanxian()) {
        $result['code'] = 500;
        $result['msg'] = '已关闭返利通道';
        exit(json_encode($result));
    }
    $_amount = $_POST['amount'];
    if (!isset($_POST['type']) || empty($_POST['type'])) {
        $result['code'] = 500;
        $result['msg'] = '未指定要提现的类型';
        exit(json_encode($result));
    }
    $_type = $_POST['type'];
    if (!in_array($_type, array('cash', 'jifenbao'))) {
        $result['code'] = 500;
        $result['msg'] = '指定的提现类型不正确';
        exit(json_encode($result));
    }
    if (empty($_amount)) {
        $result['code'] = 500;
        $result['msg'] = '未填写提现数额';
    }
    if (!is_numeric($_amount)) {
        $result['code'] = 500;
        $result['msg'] = '提现数额格式不正确';
    } else {
        $cashback = (int) xt_fanxian_cashback();
        if ($_type == 'jifenbao') {
            $cashback = $cashback * 100;
        }
        if ($_amount < $cashback) {
            $result['code'] = 500;
            $result['msg'] = '提现数额必须大于:' . $cashback;
        }
    }
    if ($result['code'] == 0) {
        $user = wp_get_current_user();
        if ($user->exists()) {
            $_fanxian = 0;
            $_tixian = 0;
            $_cash = 0;
            if ($_type == 'cash') {
                $_fanxian = xt_user_total_fanxian($user->ID);
                $_tixians = xt_total_tixian($user->ID);
                $_tixian = $_tixians[0] + $_tixians[1];
                //未审核,已完成
                $_cash = $_fanxian - $_tixian;
                //余额
            } else {
                $_fanxian = xt_user_total_jifen($user->ID);
                $_tixians = xt_total_tixian_jifen($user->ID);
                $_tixian = $_tixians[0] + $_tixians[1];
                //未审核,已完成
                $_cash = $_fanxian - $_tixian;
                //余额
            }
            if ($_amount > $_cash) {
                $result['code'] = 500;
                $result['msg'] = '提现数额超过余额';
            } else {
                $__cash = $__jifen = 0;
                if ($_type == 'jifenbao') {
                    $__jifen = $_amount;
                } else {
                    $__cash = $_amount;
                }
                xt_new_tixian(array('user_id' => $user->ID, 'cash' => $__cash, 'jifen' => $__jifen));
            }
        } else {
            $result['code'] = 500;
            $result['msg'] = '未登录';
        }
    }
    exit(json_encode($result));
}
コード例 #4
0
ファイル: xt-tixian.php プロジェクト: aspirin/wp-xintaoke
if (xt_fanxian_is_pendingtixian()) {
    exit('<div class="well">暂停提现,请稍后操作</div>');
}
$user = wp_get_current_user();
if ($user->exists()) {
    $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'cash';
    if (!in_array($type, array('cash', 'jifenbao'))) {
        $type = 'cash';
    }
    $_fanxian = 0;
    $_tixian = 0;
    $_cash = 0;
    $_cash_text = '元';
    if ($type == 'cash') {
        $_fanxian = xt_user_total_fanxian($user->ID);
        $_tixians = xt_total_tixian($user->ID);
        $_tixian = $_tixians[0] + $_tixians[1];
        //未审核,已完成
        $_cash = $_fanxian - $_tixian;
        //余额
    } else {
        $_cash_text = xt_jifenbao_text();
        $_fanxian = xt_user_total_jifen($user->ID);
        $_tixians = xt_total_tixian_jifen($user->ID);
        $_tixian = $_tixians[0] + $_tixians[1];
        //未审核,已完成
        $_cash = $_fanxian - $_tixian;
        //余额
    }
    ?>
    <form class="xt-form-tixian">
コード例 #5
0
ファイル: sys_profile.php プロジェクト: aspirin/wp-xintaoke
<?php

$total_trade_taobao = xt_total_trade();
$total_trade_paipai = xt_total_trade('paipai');
$total_trade_yiqifa = xt_total_trade('yiqifa');
$total_tixian = xt_total_tixian();
$total_fanxian = xt_total_fanxian();
$total_share = xt_total_share();
$total_user = xt_total_user();
$total_album = xt_total_album();
$count_tixian = xt_total_tixian_count();
?>
<style type="text/css">
    .xt-nums{font-family: Arial;font-size:14px;font-weight:bold;color:#F1470B;margin-right:5px;}
    .welcome-panel .welcome-panel-column{width: 20%;min-width: 150px;}
    .welcome-panel h4{margin:5px 0px;}
    .welcome-panel .welcome-panel-column ul{margin:10px 0px;}
    .wp-list-table.widefat th,.wp-list-table.widefat td{text-align:center;border-width:1px;border-left-color: #DFDFDF;border-right-width: 0px;}
    .wp-list-table.widefat td{padding:4px;}
</style>
<div class="widget-liquid-left">
    <div id="widgets-left">
        <div class="welcome-panel" style="margin-top:10px;">
            <div class="welcome-panel-column-container">
                <div class="welcome-panel-column">
                    <h4>
                        <span class="icon16 icon-page"></span> 待办
                    </h4>
                    <ul>
                        <li>未处理的提现:<a href="<?php 
echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=cash');