GanS 发表于 2013-11-16 16:37:17

phpdisk网赚版 4.2版 切换套餐bug修复

本帖最后由 GanS 于 2013-11-16 16:38 编辑

phpdisk网赚版 4.2版,
该bug为
用户每次登陆都会自动切换默认套餐,
之前找管理修复了一次,但是问题又有了
苦逼的读下代码看看哪里出问题了吧。 自己动手丰衣足食

如果 默认网赚套餐是1000==10,另一个网赚套餐是1000=50

我选择了网赚套餐1000=50,退出重新登陆就会发现你的套餐又自动换回默认套餐了。
但是我的积分兑换比率却还是1000=50。 既能用没广告的套餐又能用积分兑换比率最高的套餐{:soso_e141:}


修复方法:

文件./account.php

搜索代码$plan_id = (int)@$db->result_first("select plan_id from {$tpf}plans where is_default=1 limit 1");替换这句 //这里这段代码可能根据大家拿到的安装程序时间不一样有所区别~                                $plan_id = (int)@$db->result_first("select plan_id from {$tpf}plans where is_default=1 limit 1");
                                if($plan_id){
                                        $db->query_unbuffered("update {$tpf}users set plan_id='$plan_id' where userid='$userid' limit 1");
                                }为       //如果这里的这段代码和下面的是一样的就不用修复了~                               
   if(!get_profile($userid,'plan_id')){
                                        $plan_id = (int)@$db->result_first("select plan_id from {$tpf}plans where is_default=1 limit 1");
                                        if($plan_id){
                                        $ins = array(
                                  'plan_id'=>$plan_id,
                                  'credit_rate'=>get_plans($plan_id,'income_rate'),
                                  );
                                        $db->query_unbuffered("update {$tpf}users set ".$db->sql_array($ins)." where userid='$userid' limit 1");
                                        }
                                }
然后写个升级数据的php文件升级下默认套餐的用户兑换比率为当前设置的比率
升级完记得删除。<?php
include "includes/commons.inc.php";
$plan_id = (int)@$db->result_first("select plan_id from {$tpf}plans where is_default=1 limit 1");
$ins = array(
'credit_rate'=>get_plans($plan_id,'income_rate')
);
$alls = $db->fetch_one_array("select count(*) as total from {$tpf}users where plan_id=$plan_id");
$db->query_unbuffered("update {$tpf}users set ".$db->sql_array($ins)." where plan_id=$plan_id");
echo "执行成功,影响行数".$alls['total'];
?>

fyy2009 发表于 2013-11-18 18:56:26

本帖最后由 fyy2009 于 2013-11-18 19:10 编辑

厉害厉害。4.2确实有这个问题
页: [1]
查看完整版本: phpdisk网赚版 4.2版 切换套餐bug修复