瀏覽代碼

删除无用代码

lizhen_gitee 10 月之前
父節點
當前提交
8f59d104d6

+ 0 - 18
application/admin/controller/Takecash.php

@@ -109,24 +109,6 @@ class Takecash extends Backend
                     Db::rollback();
                     $this->error($wallet_rs['msg']);
                 }
-                /*//上级返利
-                if ($info['intro_uid'] && $info['intro_money'] > 0) {
-                    $wallet_rs = model('wallet')->lockChangeAccountRemain($info['intro_uid'],0,'money',$info['intro_money'],66,'邀请人提现奖励:'.$info['number'],'take_cash',$info['id']);
-                    if($wallet_rs['status'] === false){
-                        Db::rollback();
-                        $this->error($wallet_rs['msg']);
-                    }
-                }
-                //自动打款
-                if ($info['type'] == 1) { //微信
-
-                } elseif ($info['type'] == 2) { //支付宝
-                    $dakuanrs = $this->withdraw($info);
-                    if (!$dakuanrs) {
-                        Db::rollback();
-                        $this->error('打款失败');
-                    }
-                }*/
 
                 //系统消息
                 $msg_id = \app\common\model\Message::addMessage($info['user_id'],'提现审核','提现审核已经审核通过');

+ 2 - 2
application/api/controller/Passport.php

@@ -113,7 +113,7 @@ class Passport extends Api
     /**
      * 测试 汇付 支付
      */
-    public function testPay()
+    /*public function testPay()
     {
         $params = \request()->post();
         $order_no = $params['order_no'] ?? '';
@@ -142,7 +142,7 @@ class Passport extends Api
             'pay_info' => $pay_info,
             'order_no' => $order_no
         ]);
-    }
+    }*/
 
     /**
      * 支付回调

+ 4 - 75
application/api/controller/Pay.php

@@ -343,7 +343,7 @@ class Pay extends Api
         }
     }
 
-    public function testpay(){
+    /*public function testpay(){
         $sandpay = new \app\common\library\Sandpay();
         $sandpayParams = [];
         $res = $sandpay->wechath5($sandpayParams);
@@ -353,9 +353,9 @@ class Pay extends Api
             $this->error('失败', $res['data']);
         }
 
-    }
+    }*/
 
-    public function testsuningpay(){
+    /*public function testsuningpay(){
         $suningpay = new \app\common\library\SuningPay();
         $suningpayParams = [];
         $res = $suningpay->wechat($suningpayParams);
@@ -365,7 +365,7 @@ class Pay extends Api
             $this->error('失败', $res['data']);
         }
 
-    }
+    }*/
 
     //vip用的,创建订单废弃
     public function sand_vip_recharge(){
@@ -529,77 +529,6 @@ class Pay extends Api
         }
     }
 
-    //开通会员(废弃)
-    public function addvip() {
-        $rc_id = input('id',0);
-        $uid = $this->auth->id;
-        if(!$rc_id){
-            $this->error('请选择会员套餐');
-        }
-        //赋值money
-        $recharge_config = Db::name('payvip_config')->where('id',$rc_id)->find();
-        $money = $recharge_config['money'];
 
-        if($money<=0) {
-            $this->error('支付金额必须大于0');
-        }
-        if($money > 10000){
-            $this->error('支付金额太大');
-        }
-        //验证余额
-        $user_info = model('wallet')->getWallet($this->auth->id);
-        if ($user_info['money'] < $money) {
-            $this->success('您的余额不足', ['code' => 2]);
-        }
-        if($user_info['vip_endtime'] > time() && $recharge_config['vip_level'] < $user_info['vip_level']){
-            $this->error('当前会员没有过期,不能续费');
-        }
-
-        if($user_info['vip_endtime'] < time()){
-            //过期了
-            $vip_endtime = time() + (intval($recharge_config['days']) * 86400);
-        }else{
-            //追加vip
-            $vip_endtime = $user_info['vip_endtime'] + (intval($recharge_config['days']) * 86400);
-        }
-
-        //开启事务
-        Db::startTrans();
-        //修改会员时间
-        $update_data = [
-            'vip_endtime'=>$vip_endtime,
-            'vip_level'  =>$recharge_config['vip_level'], //修改等级,同级不影响,向上立刻改,向下不允许
-        ];
-
-        $result = Db::name('user_wallet')->where('user_id',$uid)->update($update_data);
-        if($result === false) {
-            Db::rollback();
-            $this->error('您的网络开小差啦~');
-        }
-        //扣费
-        $wallet_rs = model('wallet')->lockChangeAccountRemain($uid,0,'money',-$money,16,'开通会员:'.$recharge_config["title"]);
-        if($wallet_rs['status'] === false){
-            Db::rollback();
-            $this->error($wallet_rs['msg']);
-        }
-        //赠送金币
-        $wallet_rs = model('wallet')->lockChangeAccountRemain($uid,0,'gold',$recharge_config['gold_num'],17,'开通会员赠送金币');
-        if($wallet_rs['status'] === false){
-            Db::rollback();
-            $this->error($wallet_rs['msg']);
-        }
-
-
-        //tag任务赠送金币
-        //开通VIP 50金币
-//        $task_rs = \app\common\model\TaskLog::tofinish($uid,9);
-//        if($task_rs === false){
-//            Db::rollback();
-//            $this->error('完成任务赠送奖励失败');
-//        }
-        Db::commit();
-
-        $this->success('开通成功');
-    }
 
 }

+ 1 - 5
application/api/controller/Recharge.php

@@ -20,11 +20,7 @@ class Recharge extends Api
         parent::_initialize();
     }
 
-    //公众号支付完全放弃
-    /*public function __construct(){
-        echo __LINE__;
-        exit;
-    }*/
+
 
     //金币兑换配置列表
     public function config(){

+ 1 - 212
application/api/controller/Userwallet.php

@@ -157,54 +157,6 @@ class Userwallet extends Api
         $this->success('success',$list);
     }
 
-    //提现配置
-    public function take_cash_config(){
-
-        $data = [
-            'money' => model('wallet')->getwallet($this->auth->id,'money'),
-            'alipay_account' => '',
-            'min' => 1,
-            'max' => 1000,
-        ];
-
-        $this->success('success',$data);
-    }
-
-    //提现
-    public function take_cash(){
-        $money = floatval(input_post('money',0));
-
-        if(empty($money)){
-            $this->error();
-        }
-
-        if(empty($this->auth->idcard_status)){
-            $this->error('请先完成实名认证');
-        }
-
-        $check = Db::name('take_cash')->where(['user_id'=>$this->auth->id,'status'=>0])->find();
-        if($check){
-            $this->error('您已经申请了提现,请等待审核');
-        }
-
-        $user_money = model('wallet')->getwallet($this->auth->id,'money');
-        if($money > $user_money){
-            $this->error('提现金额不能大于可提现余额');
-        }
-
-        $data = [
-            'user_id' => $this->auth->id,
-            'number' => $money,
-            'status' => 0,
-            'createtime' => time(),
-            'updatetime' => time(),
-        ];
-
-        Db::name('take_cash')->insertGetId($data);
-
-        //审核时候再扣,或者这里先扣,等需求方确认
-        $this->success('申请成功请等待审核');
-    }
 
     //提现记录
     public function take_cash_log(){
@@ -245,142 +197,7 @@ class Userwallet extends Api
         $this->success('success',$return_data);
     }
     
-    //提现(废弃)
-    public function withdrawal_feiqi() {
-        if ($this->auth->idcard_status != 1) {
-            $this->error('请先完成实名认证~');
-        }
-
-        $id = input('id', 0, 'intval');
-        $type = input('type', 0, 'intval'); //账户类型:1=微信,2=支付宝
-        if (!$id) {
-            $this->error('您的网络开小差啦~');
-        }
-        $withdrawal_config = Db::name('withdrawal_config')->find($id);
-        if (!$withdrawal_config) {
-            $this->error('提现金额不存在~');
-        }
-        if ($withdrawal_config['is_show'] != 1) {
-            $this->error('提现金额暂未开放~');
-        }
-        if ($withdrawal_config['money'] <= 0 || $withdrawal_config['real_money'] <= 0 || $withdrawal_config['money'] < $withdrawal_config['real_money']) {
-            $this->error('提现金额异常~');
-        }
-        if (!in_array($type, [1, 2])) {
-            $this->error('请选择提现账户~');
-        }
-        if ($type != 2) {
-            $this->error('提现方式请选择支付宝');
-        }
 
-        //扣除金额
-        $money = floatval($withdrawal_config['money']);
-
-        $check = Db::name('take_cash')->where(['user_id'=>$this->auth->id,'status'=>0])->find();
-        if($check){
-            $this->error('您已经申请了提现,请等待审核');
-        }
-        $time = strtotime(date('Y-m-d'));
-        $check = Db::name('take_cash')->where(['user_id'=>$this->auth->id, 'wallet_id'=>$id, 'createtime' => ['egt', $time]])->find();
-        if($check){
-            $this->error('您今日已经提现过该额度');
-        }
-
-        $user_money = model('wallet')->getwallet($this->auth->id,'money');
-        if($money > $user_money){
-            $this->error('可提现余额不足');
-        }
-
-        if ($type == 1) { //微信
-            $alipay_account = '';
-        } else { //支付宝
-            $user_bank_info = Db::name('user_bank')->where(['user_id' => $this->auth->id, 'type' => 1])->find();
-            if (!$user_bank_info) {
-                $this->error('请先绑定支付宝');
-            }
-            $alipay_account = $user_bank_info['banknumber'];
-            $realname = $user_bank_info['realname'];
-
-
-        }
-        $data = [
-            'user_id' => $this->auth->id,
-            'wallet_id' => $id,
-            'number' => $money,
-            'money' => $withdrawal_config['real_money'],
-            'alipay_account' => $alipay_account,
-            'status' => 0,
-            'createtime' => time(),
-            'updatetime' => time(),
-            'type' => $type,
-            'realname' => $realname
-        ];
-        //计算上级可获得金额
-        if ($this->auth->intro_uid) {
-            $data['intro_uid'] = $this->auth->intro_uid;
-            //获取返利比率
-            $intro_withdrawal_rebate_rate = (int)config('site.intro_withdrawal_rebate_rate');
-            if ($intro_withdrawal_rebate_rate > 0 && $intro_withdrawal_rebate_rate <= 100) {
-                //上级获得金额数量
-                $intro_uid_money = number_format($money * $intro_withdrawal_rebate_rate / 100, 2, '.', '');
-                if ($intro_uid_money > 0) {
-                    $data['intro_money'] = $intro_uid_money;
-                }
-            }
-        }
-
-        $msg = '申请成功请等待审核';
-
-        //开启事务
-        Db::startTrans();
-        $log_id = Db::name('take_cash')->insertGetId($data);
-        if (!$log_id) {
-            Db::rollback();
-            $this->error('您的网络开小差啦~');
-        }
-        if ($withdrawal_config['type'] == 1) { //秒到账,无需审核
-            $info = Db::name('take_cash')->find($log_id);
-            //扣钱
-            $wallet_rs = model('wallet')->lockChangeAccountRemain($info['user_id'],0,'money',-$info['number'],15,'提现:'.$info['number'],'take_cash',$info['id']);
-            if($wallet_rs['status'] === false){
-                Db::rollback();
-                $this->error($wallet_rs['msg']);
-            }
-            //上级返利
-            if ($info['intro_uid'] && $info['intro_money'] > 0) {
-                $wallet_rs = model('wallet')->lockChangeAccountRemain($info['intro_uid'],$info['user_id'],'money',$info['intro_money'],66,'邀请人提现奖励:'.$info['number'],'take_cash',$info['id']);
-                if($wallet_rs['status'] === false){
-                    Db::rollback();
-                    $this->error($wallet_rs['msg']);
-                }
-            }
-            //自动打款
-            if ($info['type'] == 1) { //微信
-
-            } elseif ($info['type'] == 2) { //支付宝
-                $dakuanrs = $this->withdraw($info);
-                if (!$dakuanrs) {
-                    Db::rollback();
-                    $this->error('打款失败');
-                }
-            }
-            //修改提现记录状态
-            $take_cash_result = Db::name('take_cash')->where(['id' => $log_id, 'status' => 0])->setField('status', 1);
-            if (!$take_cash_result) {
-                Db::rollback();
-                $this->error('打款失败');
-            }
-
-            //系统消息
-            $msg_id = \app\common\model\Message::addMessage($info['user_id'],'提现','您的提现已经到账');
-
-            $msg = '提现成功';
-        }
-
-        Db::commit();
-        //审核时候再扣,或者这里先扣,等需求方确认
-        $this->success($msg);
-    }
 
     //提现
     public function withdrawal() {
@@ -493,35 +310,7 @@ class Userwallet extends Api
         $this->success($msg);
     }
 
-    //提现转账(新版2020-01-01)
-    public function withdraw($info) {
-        $data['out_biz_no'] = getMillisecond() . mt_rand(1, 1000); //商户订单号
-        $data['trans_amount'] = $info['money']; //订单总金额,单位为元,精确到小数点后两位
-        $data['product_code'] = 'TRANS_ACCOUNT_NO_PWD';//业务产品码,收发现金红包固定为:STD_RED_PACKET;单笔无密转账到支付宝账户固定为:TRANS_ACCOUNT_NO_PWD;单笔无密转账到银行卡固定为:TRANS_BANKCARD_NO_PWD
-        $data['biz_scene'] = 'DIRECT_TRANSFER'; //描述特定的业务场景,可传的参数如下:PERSONAL_COLLECTION:C2C现金红包-领红包;DIRECT_TRANSFER:B2C现金红包、单笔无密转账到支付宝/银行卡
-        $data['order_title'] = '知音佣金发放'; //转账业务的标题,用于在支付宝用户的账单里显示
-
-        $data['payee_info']['identity'] = $info['alipay_account'];//收款方支付宝id或支付宝账户
-
-        /*if ($info['alipay_type'] == 1) { //支付宝账户
-            $data['payee_info']['identity_type'] = 'ALIPAY_LOGON_ID';
-            //收款支付宝账号真实姓名, 不为空时支付宝会验证
-            $data['payee_info']['name'] = $info['name'];
-        } else { //支付宝id
-            $data['payee_info']['identity_type'] = 'ALIPAY_USER_ID';
-            $data['payee_info']['name'] = '';
-        }*/
-        //支付宝id
-        $data['payee_info']['identity_type'] = 'ALIPAY_USER_ID';
-        $data['payee_info']['name'] = '';
-
-        //转账备注(支持200个英文/100个汉字)。当付款方为企业账户,且转账金额达到(大于等于)50000元,remark不能为空。收款方可见,会展示在收款用户的收支详情中。
-        $data['remark'] = '知音佣金发放';
-        require_once("../extend/AliPay/AliPay.php");
-        $alipay =new \AliPay();
-        $result =$alipay->AliPayWithdraw($data);
-        return $result;
-    }
+
 
     //每日数据
     public function todayincome() {