浏览代码

精秀,支付宝,alipayApp

lizhen_gitee 11 月之前
父节点
当前提交
a1a3cecb19

+ 0 - 36
application/api/controller/Usercenter.php

@@ -106,21 +106,7 @@ class Usercenter extends Api
             'alipay_account' => ($userinfo['idcard_status'] == 1 && isset($idcard_confirm['alipay_account'])) ? $idcard_confirm['alipay_account'] : '',
         ];
 
-        //亲密度,登录用户给当前用户花了多少钱
-/*        $gift_map = [
-            'user_id' => $this->auth->id,
-            'user_to_id' => $uid,
-        ];
-        $gift_user_typing = Db::name('gift_user_typing')->where($gift_map)->sum('price');//文字聊天送礼物
-        $gift_user_party  = Db::name('gift_user_party')->where($gift_map)->sum('value');//派对音聊送礼物
-        $gift_user_livebc = Db::name('gift_user_livebc')->where($gift_map)->sum('price');//直播送礼物
-
-        $match_map_str = '(user_id = '.$this->auth->id.' and to_user_id = '.$uid.') or (user_id = '.$uid.' and to_user_id = '.$this->auth->id.')';
-        $match_typing = Db::name('user_match_typing_log')->where($match_map_str)->sum('price'); //聊天
-        $match_audio  = Db::name('user_match_audio_log')->where($match_map_str)->sum('price');  //语音
-        $match_video  = Db::name('user_match_video_log')->where($match_map_str)->sum('price');  //视频
 
-        $new_data['qinmi_sum'] = $qinmi_sum = $gift_user_typing + $gift_user_party + $gift_user_livebc + $match_typing + $match_audio + $match_video;*/
 
         if ($this->auth->gender == 1) {
             $qinmi_sum = Db::name('user_intimacy')->where(['uid' => $this->auth->id, 'other_uid' => $uid])->value('value');
@@ -130,29 +116,7 @@ class Usercenter extends Api
             $qinmi_sum = 0;
         }
         $new_data['qinmi_sum'] = $qinmi_sum ? :0;
-            //解锁开关
-        /*$new_data['isshow_unlock_wechataccount'] = $qinmi_sum >= 15 ? 1 : 0;  //满足15亲密值才展示
-        if(config('site.open_unlock_wechataccount') == 0){
-            $new_data['isshow_unlock_wechataccount'] = 0; //总开关,强制隐藏
-        }
-        $new_data['isshow_unlock_secretvideo'] = $qinmi_sum >= 15 ? 1 : 0;    //满足15亲密值才展示
-        $new_data['isshow_unlock_secretvideo'] = 1;    //又不受限制了
 
-        //上次解锁过期日期
-        $check_map = [
-            'user_id' => $this->auth->id,
-            'to_user_id' => $uid,
-        ];
-        $order_secretvideo = Db::name('order_secretvideo')->where($check_map)->order('id desc')->value('endtime');
-        $order_wechataccount = Db::name('order_wechataccount')->where($check_map)->order('id desc')->value('endtime');
-        $new_data['unlock_secretvideo_endtime'] = !empty($order_secretvideo) ? $order_secretvideo : 0;
-        $new_data['unlock_secretvideo_status'] = $new_data['unlock_secretvideo_endtime'] > time() ? 1 : 0;
-        $new_data['unlock_wechataccount_endtime'] = !empty($order_wechataccount) ? $order_wechataccount : 0;
-        $new_data['unlock_wechataccount_status'] = $new_data['unlock_wechataccount_endtime'] > time() ? 1 : 0;*/
-
-        //提示语而已
-       /* $new_data['unlock_secretvideo_notice'] = '是否花费'.config('site.unlock_secretvideo').'金币解锁一周(或年费vip可每日免费解锁一次)?';
-        $new_data['unlock_wechataccount_notice'] = '是否花费'.config('site.unlock_wechataccount').'金币解锁一周(或年费vip可每日免费解锁一次)?';*/
 
         //合并
         $userinfo = array_merge($userinfo,$new_data);

+ 8 - 1
application/index/controller/Index.php

@@ -81,12 +81,19 @@ class Index extends Frontend
             'data' => $pay->getData()
         ]);
     }
-    
+
+    //精秀,微信支付跳转
     public function pay()
     {
         return $this->view->fetch();
     }
 
+    //精秀,支付宝支付跳转
+    public function alipay(){
+        $url = input('url','');
+        $this->redirect($url);
+    }
+
     public function aa(){
         return 0;
         $start_time = time() - (3600 * 1);

+ 9 - 1
application/utils/JingXiu/JingXiuPayUtil.php

@@ -42,6 +42,14 @@ class JingXiuPayUtil extends Module
         try {
             $result   = $this->addOrder($payment[$pay_type]);
             $code_url = $result['payurl'];
+
+            //跳转地址
+            $jumpurl = [
+                'wechat' => "/index/index/pay?url={$code_url}",
+                'alipay' => "/index/index/alipay?url={$code_url}",
+            ];
+            $jumpurl = $jumpurl[$pay_type];
+
         } catch (\Exception $e) {
             return $this->error('支付下单失败!' . $e->getMessage());
         }
@@ -50,7 +58,7 @@ class JingXiuPayUtil extends Module
             'total_amount' => $result['total_amount'],
             'trade_no'     => $result['trade_no'],
             'trade_type'   => $result['trade_type'],
-            'url'          => CurlUtil::getHttp("/index/index/pay?url={$code_url}")
+            'url'          => CurlUtil::getHttp($jumpurl)
         ]);
     }