|
@@ -141,7 +141,7 @@ class Alltools {
|
|
|
$userinfo = DB::table('mt_user')->select(['id','username','group_id','intro_uid','invite_uid','agent_id','gender'])->where('id',$user_id)->first();
|
|
|
|
|
|
//配置
|
|
|
- $config_site = DB::table('mt_config')->whereIn('name',['invite_recharge_rate','recharge_b2a_rate','recharge_c2a_rate','recharge_d2c_rate','recharge_c2a_rate'])->pluck('value','name');
|
|
|
+ $config_site = DB::table('mt_config')->whereIn('name',['invite_recharge_rate','recharge_b2a_rate','recharge_c2a_rate','recharge_c2a_rate'])->pluck('value','name');
|
|
|
|
|
|
//备注
|
|
|
$remark = !empty($remark) ? $remark : $userinfo->username.'充值';
|
|
@@ -263,53 +263,6 @@ class Alltools {
|
|
|
return true;//结束了
|
|
|
}
|
|
|
|
|
|
- //上级是普通用户,那自己肯定也是普通,则上级可能是D1、C1,找到上上级,如果也是普通C1,停止。如果上上级是B1,则一直追到A1
|
|
|
- if(1 == 2 && $intro_userinfo->group_id == 1){
|
|
|
- //先给上级普通用户返
|
|
|
- $recharge_d2c_rate = $config_site['recharge_d2c_rate'];//d2c 或 e2d
|
|
|
- $jewelC = bcdiv(bcmul($gold,$recharge_d2c_rate),100);
|
|
|
-
|
|
|
- $result = $this->lockChangeAccountRemain($intro_userinfo->id,'agentjewel',$jewelC,51, $userinfo->username.'充值','pay_order',$payorder_id);
|
|
|
- if($result['status']===false)
|
|
|
- {
|
|
|
- //Db::rollback();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //充值者上上级
|
|
|
- $intro_intro_userinfo = DB::table('mt_user')->select(['id','username','group_id','intro_uid','invite_uid','agent_id','gender'])->where('id',$intro_userinfo->intro_uid)->first();
|
|
|
- if(empty($intro_intro_userinfo)){return true;}
|
|
|
-
|
|
|
- //上上级也是普通C1,说明自己在E1,上级是D1,停止
|
|
|
- if($intro_intro_userinfo->group_id == 1){
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- //上上级是B1,上级是C1,自己是D1,
|
|
|
- if($intro_intro_userinfo->group_id == 2){
|
|
|
-
|
|
|
-
|
|
|
- //充值者上上级,也就是A
|
|
|
- $intro_intro_intro_userinfo = DB::table('mt_user')->select(['id','username','group_id','intro_uid','invite_uid','agent_id','gender'])->where('id',$intro_intro_userinfo->intro_uid)->first();
|
|
|
- if(empty($intro_intro_intro_userinfo)){return true;}
|
|
|
-
|
|
|
- if($intro_intro_intro_userinfo->group_id == 3){
|
|
|
-
|
|
|
- $recharge_c2a_rate = $config_site['recharge_c2a_rate'];
|
|
|
- $jewelA = bcdiv(bcmul($jewelC,$recharge_c2a_rate),100);
|
|
|
-
|
|
|
- $result = $this->lockChangeAccountRemain($intro_intro_intro_userinfo->id,'agentjewel',$jewelA,51, $userinfo->username.'充值','pay_order',$payorder_id);
|
|
|
- if($result['status']===false)
|
|
|
- {
|
|
|
- //Db::rollback();
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
return true;
|