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;
}
Beispiel #2
0
            echo $item['volume'];
            ?>
</td></tr>
                                <?php 
        } else {
            ?>
                                <tr id="X_Item-Get-Volume-Title" class="hide"><th>销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:</th><td id="X_Item-Get-Volume"></td></tr>
                                <?php 
        }
        ?>
                            <tr class="xt-price"><th>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</th><td><b>¥</b><strong id="X_Item-Get-Price"><?php 
        echo $item['price'];
        ?>
</strong></td></tr>
                            <tr class="xt-fanxian"><th>返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;利:</th><td id="X_Item-Get-Fanxian" data-type="<?php 
        echo xt_fanxian_is_jifenbao($item['from_type']) ? 'jifenbao' : 'cash';
        ?>
"></td></tr>
                            <tr class="xt-btns"><td colspan="2"><a href="<?php 
        echo $clickUrl;
        ?>
" target="_blank" class="btn btn-primary btn-large">立刻购买</a>&nbsp;&nbsp;&nbsp;&nbsp;<button id="X_Item-Get-Publish-Btn" data-url="http://auction1.paipai.com/<?php 
        echo get_the_share_key($item['share_key']);
        ?>
" type="button" class="btn btn-success btn-large X_Publish">我要分享</button></td></tr>
                        </tbody>
                    </table>
                </div>
                <div id="X_Item-Get-Recommend" class="xt-widget-recommend-side clearfix hide" data-platform="<?php 
        echo $item['from_type'];
        ?>
        <?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 {
                $cash = $isUnorder ? round($_o->brokeragePrice / 100 * $rate / 100, 2) : $_o->cash;
            }
        } else {
            $jifen = $_o->jifen;
            $cash = $_o->cash;
        }
        $price = round($_o->careAmount / 100, 2);
        echo "<tr><td class=\"xt-td-center\">" . $dealId . "</td><td>{$_item_title}</td><td class=\"xt-td-center\">{$price}</td><td class=\"xt-td-center\">{$_o->commNum}</td><td class=\"xt-td-center\">{$cash}</td><td class=\"xt-td-center\">{$jifen}</td><td class=\"xt-td-center\">{$_o->chargeTime}</td></tr>";
    }
}
?>
        <?php 
if ($_total > 0) {
    $rate = 0;
    if ($isUnorder) {
        $rate = xt_get_rate(get_current_user_id());
    }
    foreach ($_orders as $_o) {
        $_item_title = '';
        if ($_o->num_iid > 0) {
            $_item_title = '<a target="_blank" href="' . xt_jump_url(array('id' => $_o->num_iid)) . '">' . $_o->item_title . '</a>';
        } else {
            $_item_title = $_o->item_title;
        }
        $trade_id = $isUnorder ? substr_replace($_o->trade_id, str_repeat('*', strlen($_o->trade_id) - 2), 1, -1) . '<br><a data-id="' . $_o->id . '" data-platform="taobao" href="javascript:;" class="xt-unorder-open">找回</a>' : $_o->trade_id;
        $cash = $jifen = 0;
        $isJifenbao = xt_fanxian_is_jifenbao('taobao');
        if ($isUnorder) {
            if ($isJifenbao) {
                $jifen = ($isUnorder ? round($_o->commission * $rate / 100, 2) : $_o->cash) * 100;
            } else {
                $cash = $isUnorder ? round($_o->commission * $rate / 100, 2) : $_o->cash;
            }
        } else {
            $jifen = $_o->jifen;
            $cash = $_o->cash;
        }
        echo "<tr><td class=\"xt-td-center\">" . $trade_id . "</td><td>{$_item_title}</td><td class=\"xt-td-center\">{$_o->real_pay_fee}</td><td class=\"xt-td-center\">{$_o->item_num}</td><td class=\"xt-td-center\">{$cash}</td><td class=\"xt-td-center\">{$jifen}</td><td class=\"xt-td-center\">{$_o->pay_time}</td></tr>";
    }
}
?>
    function widget($args, $instance)
    {
        extract($args);
        global $xt, $xt_taobao_item;
        if ($xt->is_taobao && !empty($xt_taobao_item)) {
            echo $before_widget;
            $_pic = $xt_taobao_item->pic_url . '_310x310.jpg';
            $_title = $xt_taobao_item->title;
            $_seller = $xt_taobao_item->nick;
            $_url = xt_jump_url(array('id' => $xt_taobao_item->num_iid));
            ?>
                <div class="row-fluid">
                    <div class="span9">
                        <div class="media">
                            <a href="<?php 
            echo $_url;
            ?>
" class="pull-left" target="_blank">
                                <?php 
            xt_write_pic(base64_encode($_pic), $_title);
            ?>
                                <span class="X_Fanxian-Tip"><i>返现金额与实际成交价相关</i></span>
                            </a>
                            <div class="media-body">
                                <h1 class="media-heading"><a style="width:310px;" id="X_Detail-Item-Get-Title" data-id="<?php 
            echo $xt_taobao_item->num_iid;
            ?>
" href="<?php 
            echo $_url;
            ?>
" target="_blank" class="text-gray"><?php 
            echo $_title;
            ?>
</a></h1>
                                <p class="clearfix">
                                <table class="table">
                                    <tbody>
                                        <tr><th>店&nbsp;掌&nbsp;柜:</th><td><a id="X_Detail-Item-Get-Seller" href="javascript:;" target="_blank"><?php 
            echo $xt_taobao_item->nick;
            ?>
</a></td></tr>
                                        <tr><th>所&nbsp;在&nbsp;地:</th><td><?php 
            echo $xt_taobao_item->location->state . '&nbsp;&nbsp;' . $xt_taobao_item->location->city;
            ?>
</td></tr>
                                        <tr id="X_Detail-Item-Get-Volume-Title" class="hide"><th>销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:</th><td id="X_Detail-Item-Get-Volume"></td></tr>
                                        <tr class="xt-price"><th>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</th><td><b>¥</b><strong id="X_Detail-Item-Get-Price"><?php 
            echo $xt_taobao_item->price;
            ?>
</strong></td></tr>
                                        <tr class="xt-fanxian"><th>返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;利:</th><td id="X_Detail-Item-Get-Fanxian" data-type="<?php 
            echo xt_fanxian_is_jifenbao('taobao') ? 'jifenbao' : 'cash';
            ?>
"></td></tr>
                                        <tr class="xt-btns">
                                            <td colspan="2"><a href="<?php 
            echo $_url;
            ?>
" target="_blank" class="btn btn-primary btn-large">立刻购买</a>&nbsp;&nbsp;&nbsp;&nbsp;<button id="X_Detail-Item-Get-Publish-Btn" data-url="<?php 
            echo $xt_taobao_item->detail_url;
            ?>
" type="button" class="btn btn-success btn-large X_Publish">我要分享</button></td>
                                        </tr>
                                    </tbody>
                                </table>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="span3">
                        <div id="X_Detail-Item-Get-Recommend" class="xt-widget-recommend-side clearfix" data-platform="taobao" data-cid="<?php 
            echo $xt_taobao_item->cid;
            ?>
" data-id="<?php 
            echo $xt_taobao_item->num_iid;
            ?>
">
                            <div class="hd"><h4 class="xt-bd-l"><span>猜你喜欢</span></h4></div>
                            <div class="bd" style="padding:10px 0 5px;">
                                <ul class="media-list">
                                </ul>               
                            </div>
                        </div>
                    </div>
                </div>
                <?php 
            echo $after_widget;
        }
    }
Beispiel #6
0
function get_the_share_detail_template()
{
    global $xt_user_avatar;
    $cacheObj = get_the_share_cachedata();
    $_item = $cacheObj['item'];
    $_title = get_the_share_title();
    $_fxText = '元';
    $isJifenbao = xt_fanxian_is_jifenbao(get_the_share_fromtype());
    if ($isJifenbao) {
        $_fxText = xt_jifenbao_text();
    }
    ?>
    <script type="text/javascript">
        if(typeof(XT)!='undefined'){XT.share_id=<?php 
    the_share_id();
    ?>
;}
    </script>
    <div class="row-fluid" style="background-color:white;">
        <div class="span12 media well well-small" style="margin-left:0px;margin-bottom:0px;">
            <a style="display:block;width:40px;" class="pull-left X_Nick" data-value="<?php 
    echo get_the_share_userid();
    ?>
" href="<?php 
    xt_the_user_url(get_the_share_userid());
    ?>
" target="_blank" rel="nofollow"><img src="<?php 
    xt_the_user_pic($xt_user_avatar);
    ?>
" style="width:40px;height:40px;"></a>
            <div class="media-body">
                <h5 class="media-heading"><a class="xt-red X_Nick" data-value="<?php 
    echo get_the_share_userid();
    ?>
" href="<?php 
    xt_the_user_url(get_the_share_userid());
    ?>
" target="_blank"><?php 
    the_share_username();
    ?>
</a>&nbsp;&nbsp;&nbsp;分享了该宝贝<span class="pull-right"><?php 
    the_share_time_human();
    ?>
</span></h5>
                <div class="media" style="margin-top:0px;"><?php 
    the_share_content();
    ?>
</div>
            </div>
        </div>
        <div class="span12 media" style="margin-left:0px;padding:5px;">
            <div class="pull-left">
                <a rel="nofollow" href="<?php 
    the_share_go();
    ?>
" target="_blank">
                    <img src="<?php 
    the_share_picurl(450);
    ?>
" alt="<?php 
    echo $_title;
    ?>
"/>
                    <?php 
    echo get_the_admin_tool_share(get_the_share_id());
    ?>
                </a>
            </div>
            <div class="pull-left" style="width:250px">
                <h1 style="font-size:16px;line-height:22px;margin-top: 0px;"><?php 
    echo '<img src="' . get_the_share_ico() . '"/>';
    ?>
<a rel="nofollow" title="<?php 
    echo $_title;
    ?>
" target="_blank" href="<?php 
    the_share_go();
    ?>
"><?php 
    echo $_title;
    ?>
</a></h1>
                <a id="X_Share-Detail-Buy" data-from="<?php 
    echo get_the_share_fromtype();
    ?>
" data-type="<?php 
    echo $isJifenbao ? 'jifenbao' : 'cash';
    ?>
" data-id="<?php 
    echo get_the_share_key();
    ?>
" href="<?php 
    the_share_go();
    ?>
" target="_blank" rel="nofollow" class="btn btn-primary" style="padding:4px 20px;font-size:16px;font-weight:bold;">¥<?php 
    the_share_price();
    ?>
&nbsp;去购买</a>
                <?php 
    if (xt_fanxian_is_sharebuy()) {
        ?>
                    <div class="clearfix"><?php 
        echo xt_fanxian_html('{fx}', $_fxText, 'margin-top:10px;');
        ?>
</div>
                <?php 
    }
    ?>
                <div class="clearfix" style="margin-top:10px;padding-bottom: 10px;border-bottom: 1px solid #EAEAEA;">
                    <a class="badge badge-fav" title="喜欢" data-id="<?php 
    the_share_id();
    ?>
" data-type="1" data-uid="<?php 
    the_share_userid();
    ?>
"><?php 
    the_share_favcount();
    ?>
&nbsp;&nbsp;<i class="icon-heart icon-white"></i></a>
                    <!--<a href="javascript:;" class="xt-album-add" data-id="<?php 
    //the_share_id()
    ?>
" data-pic="<?php 
    //the_share_picurl(160)
    ?>
">加入专辑</a>-->
                </div>
                <div class="well well-small clearfix" style="margin-top:15px;">
                    <?php 
    $_tags = explode(" ", get_the_share_tags());
    foreach ($_tags as $_tag) {
        echo "<a href=\"" . xt_get_shares_search_url(array('s' => $_tag)) . "\" target=\"_blank\" style=\"float: left;margin-left: 8px;\">{$_tag}</a>";
    }
    ?>
                </div>
                <?php 
    $bdshare = xt_bdshare();
    if ($bdshare > 0) {
        ?>
                    <!-- Baidu Button BEGIN -->
                    <div id="bdshare" class="bdshare_b" style="line-height: 12px;"><img src="http://share.baidu.com/static/images/type-button-1.jpg" />
                        <a class="shareCount"></a>
                    </div>
                    <script type="text/javascript">
                        document.getElementById("bdshell_js").src = "http://share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours();
                    </script>
                    <!-- Baidu Button END -->
                <?php 
    }
    ?>
            </div>
        </div>
    </div>
    <?php 
}
            <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 = (!empty($_o->actionName) ? '<p>商城:[' . str_replace('CPS', '', $_o->actionName) . ']</p>' : '') . (!empty($_o->itemTitle) ? '<p>商品:' . $_o->itemTitle . '</p>' : '');
        $orderNo = $isUnorder && $_o->orderStatus != 'F' ? substr_replace($_o->orderNo, str_repeat('*', strlen($_o->orderNo) - 2), 1, -1) . '<br><a data-id="' . $_o->id . '" data-platform="yiqifa" href="javascript:;" class="xt-unorder-open">找回</a>' : $_o->orderNo;
        $cash = $jifen = 0;
        if ($_o->orderStatus != 'F') {
            $isJifenbao = xt_fanxian_is_jifenbao('yiqifa');
            if ($isUnorder) {
                if ($isJifenbao) {
                    $jifen = ($isUnorder ? round($_o->commission * $rate / 100, 2) : $_o->cash) * 100;
                } else {
                    $cash = $isUnorder ? round($_o->commission * $rate / 100, 2) : $_o->cash;
                }
            } else {
                $jifen = $_o->jifen;
                $cash = $_o->cash;
            }
        }
        $orderStatus = xt_report_yiqifa_status($_o->orderStatus);
        echo "<tr><td class=\"xt-td-center\">" . $orderNo . "</td><td>{$_item_title}</td><td class=\"xt-td-center\">{$_o->itemPrice}</td><td class=\"xt-td-center\">{$_o->itemNums}</td><td class=\"xt-td-center\">{$cash}</td><td class=\"xt-td-center\">{$jifen}</td><td class=\"xt-td-center\">{$_o->orderTime}</td><td class=\"xt-td-center\">{$orderStatus}</td></tr>";
    }
}
Beispiel #8
0
if (isset($_REQUEST['type']) && ($_REQUEST['type'] == 'tuan' || $_REQUEST['type'] == 'bijia')) {
    $_url = urldecode($_url);
}
?>
<div class="row-fluid">
    <div class="span12" style="min-height: 0px;">

        <?php 
if ($_fx > 0 && xt_is_fanxian()) {
    ?>
            <div class="alert" style="width:630px;margin:0 auto;margin-bottom: 15px;">
                <span>登录后购买最高可返还&nbsp;<strong class="text-default"><?php 
    echo $_REQUEST['fx'];
    ?>
</strong>&nbsp;<span><?php 
    echo isset($_REQUEST['from_type']) && xt_fanxian_is_jifenbao($_REQUEST['from_type']) ? xt_jifenbao_text() : '元';
    ?>
</span>。</span>
                <a target="_top" href="<?php 
    echo $_url;
    ?>
">先购物,再返利</a>
            </div>
            <?php 
} elseif (isset($_REQUEST['fx'])) {
    ?>
            <div class="alert" style="width:630px;margin:0 auto;margin-bottom: 15px;">
                <a target="_top" href="<?php 
    echo $_url;
    ?>
">不登录,直接访问</a>
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 
}
Beispiel #10
0
            echo xt_get_rate();
            ?>
;
                        var fx = '';
                        TOP.api({ 
                            method:'taobao.taobaoke.widget.items.convert', 
                            fields:'commission',
                            num_iids:<?php 
            echo $_id;
            ?>
                        },function(resp){
                            try{
                                if(resp.taobaoke_items.taobaoke_item){
                                    fx = Math.round((resp.taobaoke_items.taobaoke_item[0].commission*RATE*100))/10000;
            <?php 
            if (xt_fanxian_is_jifenbao('taobao')) {
                echo "fx = Math.round(fx*100);";
            } else {
                echo "fx = Math.round(fx*100)/100;";
            }
            ?>
                            } 	
                        }catch(e){
                        }
                        var params={
                            page:'jump',
                            url:'<?php 
            echo base64_encode($_url);
            ?>
',
                            type:'<?php