Esempio n. 1
0
function xt_report_fanxian_result($platform, $commission, $buyer, $sharer, $adser)
{
    $result = array('isValid' => 0, 'commission' => $commission, 'income' => $commission, 'buy' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0), 'share' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0), 'ads' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0));
    $isJifen = xt_fanxian_is_jifenbao($platform);
    if ($isJifen) {
        $result['commission'] = $commission * 100;
    }
    $rate = $share_rate = 0;
    $total = 0;
    if ($sharer->exists()) {
        $result['share']['user_id'] = $sharer->ID;
        $result['share']['user_name'] = $sharer->user_login;
        if (xt_fanxian_is_share()) {
            $share_rate = xt_get_sharerate($sharer->ID);
            if ($share_rate > 0) {
                $fanxian = $jifen = 0;
                if ($isJifen) {
                    $jifen = round($commission * $share_rate / 100, 2) * 100;
                } else {
                    $fanxian = round($commission * $share_rate / 100, 2);
                }
                $result['share']['rate'] = $share_rate;
                $result['share']['cash'] = $fanxian;
                $result['share']['jifen'] = $jifen;
                $total += $share_rate;
            }
        }
    }
    if ($buyer->exists()) {
        $result['buy']['user_id'] = $buyer->ID;
        $result['buy']['user_name'] = $buyer->user_login;
        $rate = xt_get_rate($buyer->ID);
        if ($sharer->exists() && !xt_fanxian_is_sharebuy()) {
            //share no buy
            $rate = 0;
        }
        if ($rate > 0) {
            $fanxian = $jifen = 0;
            if ($isJifen) {
                $jifen = round($commission * $rate / 100, 2) * 100;
            } else {
                $fanxian = round($commission * $rate / 100, 2);
            }
            $result['buy']['rate'] = $rate;
            $result['buy']['cash'] = $fanxian;
            $result['buy']['jifen'] = $jifen;
            $total += $rate;
        }
        if ($adser->exists()) {
            $result['ads']['user_id'] = $adser->ID;
            $result['ads']['user_name'] = $adser->user_login;
            if (xt_fanxian_is_ad()) {
                $adrate = xt_get_adrate($adser);
                if ($adrate > 0) {
                    $fanxian = $jifen = 0;
                    if ($isJifen) {
                        $jifen = round($commission * $adrate / 100, 2) * 100;
                    } else {
                        $fanxian = round($commission * $adrate / 100, 2);
                    }
                    $result['ads']['rate'] = $adrate;
                    $result['ads']['cash'] = $fanxian;
                    $result['ads']['jifen'] = $jifen;
                    $total += $adrate;
                }
            }
        }
    }
    if ($total <= 90) {
        $result['isValid'] = 1;
        $result['income'] = round($commission * (90 - $total) / 100, 2);
    }
    return $result;
}
Esempio n. 2
0
function xt_widget_template_grid_sidesmall($args)
{
    extract($args);
    ?>
    <div class="hd">
        <h4 class="xt-bd-l" <?php 
    echo !empty($title) ? '' : 'style="display:none"';
    ?>
><span><?php 
    echo $title;
    ?>
</span></h4>
    </div>
    <div class="bd">
        <ul class="media-list">
            <?php 
    if (!empty($items)) {
        $rate = xt_get_rate();
        $_count = 0;
        if (empty($count)) {
            $count = count($items);
        }
        $fanxianText = '元';
        $platform = '';
        $isJifenbao = false;
        if ($type == 'taobao' || $type == 'coupon' || $type == 'temai') {
            $platform = 'taobao';
        } elseif ($type == 'paipai') {
            $platform = 'paipai';
        }
        if ($platform) {
            if (xt_fanxian_is_jifenbao($platform)) {
                $isJifenbao = true;
                $fanxianText = xt_jifenbao_text();
            }
        }
        foreach ($items as $item) {
            if ($_count >= $count) {
                break;
            }
            switch ($type) {
                case 'taobao':
                    xt_widget_template_grid_sidesmall_item_taobao($_count, $rate, $item, $isJifenbao, $fanxianText);
                    break;
                case 'paipai':
                    xt_widget_template_grid_sidesmall_item_paipai($_count, $rate, $item, $isJifenbao, $fanxianText);
                    break;
                case 'share':
                    xt_widget_template_grid_sidesmall_item_share($_count, $rate, $item);
                    break;
                case 'coupon':
                    xt_widget_template_grid_sidesmall_item_coupon($_count, $rate, $item, $isJifenbao, $fanxianText);
                    break;
                case 'temai':
                    xt_widget_template_grid_sidesmall_item_temai($_count, $rate, $item, $isJifenbao, $fanxianText);
                    break;
                case 'bijia':
                    xt_widget_template_grid_sidesmall_item_bijia($_count, $rate, $item);
                    break;
                case 'tuan':
                    xt_widget_template_grid_sidesmall_item_tuan($_count, $rate, $item);
                    break;
            }
            $_count++;
        }
        ?>

                <?php 
    }
    ?>
        </ul>
    </div>
    <?php 
}
Esempio n. 3
0
            <th>成交价格</th>
            <th>数量</th>
            <th>可返现金</th>
            <th>可返<?php 
echo xt_jifenbao_text();
?>
</th>
            <th>交易时间</th>
        </tr>
    </thead>	
    <tbody>	
        <?php 
if ($_total > 0) {
    $rate = 0;
    if ($isUnorder) {
        $rate = xt_get_rate(get_current_user_id());
    }
    foreach ($_orders as $_o) {
        $_item_title = '';
        if ($_o->commId) {
            $_item_title = '<a target="_blank" href="' . xt_jump_url(array('id' => $_o->commId, 'type' => 'paipai')) . '">' . $_o->commName . '</a>';
        } else {
            $_item_title = $_o->commName;
        }
        $dealId = $isUnorder ? substr_replace($_o->dealId, str_repeat('*', strlen($_o->dealId) - 2), 1, -1) . '<br><a data-id="' . $_o->id . '" data-platform="paipai" href="javascript:;" class="xt-unorder-open">找回</a>' : $_o->dealId;
        $cash = $jifen = 0;
        $isJifenbao = xt_fanxian_is_jifenbao('paipai');
        if ($isUnorder) {
            if ($isJifenbao) {
                $jifen = ($isUnorder ? round($_o->brokeragePrice / 100 * $rate / 100, 2) : $_o->cash) * 100;
            } else {
Esempio n. 4
0
        }
    }
} elseif ($IS_URL_CONVERT) {
    $app = xt_get_app_taobao();
    if (!empty($app) && !empty($app['appKey']) && !empty($app['appSecret'])) {
        if (xt_get_rate() > 0) {
            $TB_SHOW = true;
            ?>
                <script src="http://l.tbcdn.cn/apps/top/x/sdk.js?appkey=<?php 
            echo $app['appKey'];
            ?>
"></script>
                <script type="text/javascript">
                    jQuery(function($){
                        var RATE = <?php 
            echo xt_get_rate();
            ?>
;
                        var url = '<?php 
            echo $_url;
            ?>
';
                        var redirect_to = encodeURIComponent('<?php 
            echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            ?>
');
                        TOP.api({ 
                            method:'taobao.taobaoke.widget.url.convert', 
                            url:'<?php 
            echo $_url;
            ?>