Browse Source

删除注释代码

lizhen_gitee 9 months ago
parent
commit
c600224a36

+ 0 - 15
application/admin/controller/Useridconfirm.php

@@ -108,22 +108,7 @@ class Useridconfirm extends Backend
                     Db::rollback();
                     $this->error('完成任务赠送奖励失败');
                 }
-                /*//完成本人基本资料 +15金币《所有资料完善,包括真人认证和实名认证》
-                $task_rs = \app\common\model\TaskLog::tofinish($info['user_id'],5);
-                if($task_rs === false){
-                    Db::rollback();
-                    $this->error('完成任务赠送奖励失败');
-                }
 
-                //邀请人拿奖励,男性3元
-                $intro_money = $userinfo['gender'] == 1 ? config('site.intro_man_money') : config('site.intro_woman_money');
-                if($userinfo['real_status'] == 1 && !empty($userinfo['intro_uid']) && $intro_money > 0){
-                    $task_rs = model('wallet')->lockChangeAccountRemain($userinfo['intro_uid'],$info['user_id'],'money',$intro_money,63,$remark='');
-                    if($task_rs['status'] === false){
-                        Db::rollback();
-                        $this->error($task_rs['msg']);
-                    }
-                }*/
 
                 //系统消息
                 $msg_id = \app\common\model\Message::addMessage($info['user_id'],'实名认证','实名认证已经审核通过');

+ 1 - 12
application/api/controller/Task.php

@@ -159,18 +159,7 @@ class Task extends Api
                     $this->error($res1['msg']);
                 }
             } elseif ($this->auth->gender == 0) {
-                /*$bili  = config('site.money_to_gold');    //钱和金币兑换比例
-                if ($bili > 0) {
-                    //女用户获得钱
-                    $money = bcdiv($taskInfo['exp'], $bili, 2);
-                    if ($money > 0) {
-                        $res1 = model('wallet')->lockChangeAccountRemain($this->auth->id,0, 'money', $money, 67, '完成' .$taskInfo['name'] . '任务', 'task_log', $tasklogInfo['id']);
-                        if ($res1['status'] === false) {
-                            Db::rollback();
-                            $this->error($res1['msg']);
-                        }
-                    }
-                }*/
+
                 $res1 = model('wallet')->lockChangeAccountRemain($this->auth->id,0, 'gold', $taskInfo["exp"], 67, '完成' . $taskInfo['name'] . '任务', 'task_log', $tasklogInfo['id']);
                 if ($res1['status'] === false) {
                     Db::rollback();

+ 2 - 48
application/api/controller/User.php

@@ -921,48 +921,11 @@ class User extends Api
                 }
             }
         }
-       /*if (isset($data['intro_uid'])) { //邀请人获得金币
-           $intro_gold = config('site.intro_gold');
-           if ($intro_gold > 0) {
-               $wallet_rs = model('wallet')->lockChangeAccountRemain($data['intro_uid'],$this->auth->id,'gold',$intro_gold,64,'邀请注册奖励','user', $this->auth->id);
-               if($wallet_rs['status'] === false){
-                   Db::rollback();
-                   $this->error($wallet_rs['msg']);
-               }
-           }
-       }*/
+
 
         Db::commit();
 
-        /*//开启事务
-        Db::startTrans();
-        //所有基本资料完成
-        $user_info = Db::name('user')->where('id',$this->auth->id)->find();
-        if($user_info['hometown_cityid'] && $user_info['job_id'] && $user_info['education_id'] && $user_info['wages_id'] && $user_info['character_id'] && $user_info['stature_id'] && $user_info['weight'] && $user_info['height'] && $user_info['marital_id']){
-            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,6);
-            if($task_rs === false){
-                Db::rollback();
-                $this->error('完成任务赠送奖励失败');
-            }
-        }
-        //兴趣爱好
-        if($user_info['hobby_ids']){
-            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,7);
-            if($task_rs === false){
-                Db::rollback();
-                $this->error('完成任务赠送奖励失败');
-            }
-        }
-        //个人标签
-        if($user_info['tag_ids']){
-            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,8);
-            if($task_rs === false){
-                Db::rollback();
-                $this->error('完成任务赠送奖励失败');
-            }
-        }
 
-        Db::commit();*/
         $this->success();
     }
 
@@ -1421,16 +1384,7 @@ class User extends Api
             Db::rollback();
             $this->error('修改失败');
         }
-        /*if (isset($data['intro_uid'])) { //邀请人获得金币
-            $intro_gold = config('site.intro_gold');
-            if ($intro_gold > 0) {
-                $wallet_rs = model('wallet')->lockChangeAccountRemain($data['intro_uid'],$this->auth->id,'gold',$intro_gold,64,'邀请注册奖励','user', $this->auth->id);
-                if($wallet_rs['status'] === false){
-                    Db::rollback();
-                    $this->error($wallet_rs['msg']);
-                }
-            }
-        }*/
+
         //上传头像加5金币
         if(isset($data['avatar'])){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,19);

+ 0 - 140
application/api/controller/Userfollow.php

@@ -124,36 +124,7 @@ class Userfollow extends Api
         if($check){
             $this->error('已经关注此人');
         }
-        /*//查询自己是否是会员, 不是会员需要赠送礼物
-        $vip_endtime = Db::name('user_wallet')->where('user_id',$this->auth->id)->value('vip_endtime');
-        $time = time();
-        if ($vip_endtime < $time) {
-            $user_id = $follow_uid;// 赠送对象
-            if (!$gift_id) {
-                $this->error('请选择要赠送的礼物');
-            }
-            if ($number < 1) {
-                $this->error('请输入正确赠送礼物数量');
-            }
-
-            // 获取礼物信息
-            $giftinfo = Db::name('gift')->where('id',$gift_id)->find();
-            if (!$giftinfo)
-            {
-                $this->error("请选择礼物");
-            }
-            $giftvalue = bcmul($giftinfo['value'],$number);
 
-            //被赠送人信息
-            $touserinfo = $checkuser;
-
-            // 判断当前用户余额
-            $user_gold = model('wallet')->getWallet($this->auth->id,'gold');
-            if($user_gold < $giftvalue)
-            {
-                $this->error("您的金币余额不足");
-            }
-        }*/
 
         //查询对方是否关注自己
         $where = [
@@ -183,117 +154,6 @@ class Userfollow extends Api
             }
         }
 
-        //赠送礼物
-//        if ($vip_endtime < $time) {
-//            // 添加礼物赠送记录表
-//            $data = [
-//                'user_id' => $this->auth->id,
-//                'user_to_id' => $user_id,
-//                'gift_id' => $giftinfo['id'],
-//                'gift_name' => $giftinfo['name'],
-//                'number' => $number,
-//                'price' => $giftvalue,
-//                'createtime' => time(),
-//            ];
-//            $log_id = Db::name('gift_user_typing')->insertGetId($data);
-//            if(!$log_id){
-//                Db::rollback();
-//                $this->error('赠送失败');
-//            }
-//
-//            if($giftvalue > 0){
-//                // 扣除当前用户余额
-//                $wallet_rs = model('wallet')->lockChangeAccountRemain($this->auth->id,$user_id,'gold',-$giftvalue,53,'赠送礼物:'.$giftinfo["name"] . '*' . $number,'gift_user_typing',$log_id);
-//                if($wallet_rs['status'] === false){
-//                    Db::rollback();
-//                    $this->error($wallet_rs['msg']);
-//                }
-//
-//                // 添加赠送用户余额
-//                $money_to_gold = config('site.money_to_gold');
-//                $gift_plat_scale = config('site.gift_plat_scale');
-//
-//                $giftmoney = bcdiv($giftvalue,$money_to_gold,2);
-//
-//                $money = bcdiv(bcmul($giftmoney,100 - $gift_plat_scale,2),100,2);
-//                $wallet_rs = model('wallet')->lockChangeAccountRemain($user_id,$this->auth->id,'money',$money,54,'获得礼物:'.$giftinfo["name"] . '*' . $number,'gift_user_typing',$log_id,2);
-//                if($wallet_rs['status'] === false){
-//                    Db::rollback();
-//                    $this->error($wallet_rs['msg']);
-//                }
-//
-//                /*//增加赠送用户上级金币
-//                if ($touserinfo['intro_uid']) {
-//                    //获取返利比率
-//                    $intro_gift_rebate_rate = (int)config('site.intro_gift_rebate_rate'); //邀请人收礼物返利比率
-//                    if ($intro_gift_rebate_rate > 0 && $intro_gift_rebate_rate <= 100) {
-//                        //上级获得金币数量
-//                        $intro_uid_gold = floor($giftvalue * $intro_gift_rebate_rate / 100);
-//                        if ($intro_uid_gold > 0) {
-//                            $intro_result = model('Wallet')->lockChangeAccountRemain($touserinfo['intro_uid'],$user_id,'gold',$intro_uid_gold,66, '聊天礼物获赠奖励','gift_user_typing',$log_id);
-//                            if($intro_result['status']===false)
-//                            {
-//                                Db::rollback();
-//                                $this->error($intro_result['msg']);
-//                            }
-//                        }
-//                    }
-//                }*/
-//
-//                //增加赠送用户上级余额
-//                if ($touserinfo['intro_uid']) {
-//                    //获取返利比率
-//                    $is_agent = Db::name('user')->where(['id' => $touserinfo['intro_uid']])->value('is_agent');
-//                    $intro_income_rebate_rate = $is_agent ? (int)config('site.h_intro_income_rebate_rate') : (int)config('site.intro_income_rebate_rate'); //邀请人收礼物返利比率
-//                    if ($intro_income_rebate_rate > 0 && $intro_income_rebate_rate <= 100) {
-//                        //上级获得金额
-//                        $intro_uid_money = number_format($money * $intro_income_rebate_rate / 100, 2, '.', '');
-//                        if ($intro_uid_money > 0) {
-//                            $intro_result = model('Wallet')->lockChangeAccountRemain($touserinfo['intro_uid'],$user_id,'money',$intro_uid_money,68, '邀请人聊天礼物获赠奖励','gift_user_typing',$log_id);
-//                            if($intro_result['status']===false)
-//                            {
-//                                Db::rollback();
-//                                $this->error($intro_result['msg']);
-//                            }
-//                        }
-//                    }
-//                }
-//
-//                if ($this->auth->gender == 1 && $touserinfo['gender'] == 0) {
-//                    //增加亲密度
-//                    $user_intimacy_rs = addintimacy($this->auth->id, $user_id, $giftvalue);
-//                    if (!$user_intimacy_rs['status']) {
-//                        Db::rollback();
-//                        $this->error('您的网络开小差啦~');
-//                    }
-//                }
-//            }
-//
-//            //tag任务赠送金币
-//            //搭讪奖励
-////        $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,15);
-////        if($task_rs === false){
-////            Db::rollback();
-////            $this->error('完成任务赠送奖励失败');
-////        }
-//
-//            //发送消息
-//            if (isset($user_intimacy_rs) && $user_intimacy_rs['level_remark']) {
-//                $tenim = new \app\api\controller\Tenim;
-//                $tenim->sendMessageToUser($this->auth->id, $user_id, $user_intimacy_rs['level_remark'], 1);
-//            }
-//
-//            $return_data['money'] = $money; //获得金额
-//            $return_data['level_remark'] = isset($user_intimacy_rs) ? $user_intimacy_rs['level_remark'] : ''; //亲密度等级提示语
-//        }
-
-        //tag任务赠送金币
-        //关注3人加3金币
-//        $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,2);
-//        if($task_rs === false){
-//            Db::rollback();
-//            $this->error('完成任务赠送奖励失败');
-//        }
         //系统消息
         $msg_id = \app\common\model\Message::addMessage($this->auth->id,'喜欢','您已喜欢用户' . $checkuser['nickname']);