Pārlūkot izejas kodu

充值给上级用户返奖励

lizhen_gitee 1 gadu atpakaļ
vecāks
revīzija
ccb5dfe949

+ 13 - 0
application/api/controller/Notifynew.php

@@ -73,6 +73,7 @@ class Notifynew extends Api
         }
 
         //逻辑开始
+        //加钱
         $args = json_decode($orderInfo['args'],true);
         $result = model('Wallet')->lockChangeAccountRemain($orderInfo['user_id'],$args['jewel'],'+',0,'金币充值',1,'jewel');
         if($result['status']===false)
@@ -80,6 +81,18 @@ class Notifynew extends Api
             Db::rollback();
             return false;
         }
+        //找到上级用户并加钱
+        $userinfo = Db::name('user')->where('id',$orderInfo['user_id'])->field('id,nickname,pre_userid')->find();
+        if($userinfo['pre_userid']){
+            $bili = config('site.introsite_recharge_intro_bili') ?: 3;
+            $jewel = bcdiv(bcmul($args['jewel'],$bili,0),100,0);
+            $result = model('Wallet')->lockChangeAccountRemain($userinfo['pre_userid'],$jewel,'+',0,$userinfo['nickname'].'充值金币返奖励',2,'jewel');
+            if($result['status']===false)
+            {
+                Db::rollback();
+                return false;
+            }
+        }
         //逻辑结束
 
         //状态

+ 2 - 2
application/common/model/Config.php

@@ -108,8 +108,8 @@ class Config extends Model
             'currency' => '货币比例配置',
             'other' => '其他配置',
             'invite' => '邀请配置',
-            'androidversion' => '安卓版本更新',
-            'iosversion' => 'ios版本更新',
+//            'androidversion' => '安卓版本更新',
+//            'iosversion' => 'ios版本更新',
 //            'indexpipei' => '首页匹配',
             'takecash' => '提现',
 //            'kaiguan' => '开关',

+ 1 - 0
application/extra/site.php

@@ -79,4 +79,5 @@ return [
     'max_withdrawal_money' => '10000',
     'withdrawal_plat_bili' => '6',
     'gift_plat_scale' => '15',
+    'introsite_recharge_intro_bili' => '3',
 ];

+ 1 - 0
application/extra/wallet.php

@@ -7,6 +7,7 @@ return [
         //jewel
         0  => '后台变动',   //增减
         1  => '充值',  //增加
+        2  => '下级充值',  //增加
         3  => '赠送礼物',   //减少
         6  => '购买装扮',    //减少
         11 => '私聊转账',  //减少