Browse Source

聊天,语音,视频的收费

lizhen_gitee 2 months ago
parent
commit
c7897d7340
1 changed files with 6 additions and 17 deletions
  1. 6 17
      application/api/controller/Usercenter.php

+ 6 - 17
application/api/controller/Usercenter.php

@@ -469,7 +469,7 @@ class Usercenter extends Api
     //打字聊天每句话调用一次
     public function chat_once(){
         if ($this->auth->is_kefu == 1) { //我是客服或者对方是客服
-            $this->success('success',array('money'=>'free'));
+            $this->success('success',['money' => 'free']);
         }
 
         if ($this->auth->gender == 0) { //女生不花钱
@@ -483,23 +483,12 @@ class Usercenter extends Api
             $this->error('不存在的用户');
         }
         if ($to_user_info['is_kefu'] == 1) { //我是客服或者对方是客服
-            $this->success('success',array('money'=>'free'));
+            $this->success('success',['money' => 'free']);
         }
         if ($to_user_info['gender'] != 0) {
             $this->error('同性不能聊天~');
         }
 
-        //互关不要钱
-        $where = [
-            'uid' => $this->auth->id,
-            'follow_uid' => $to_user_id,
-            'status' => 1,
-        ];
-        $is_friend = Db::name('user_follow')->where($where)->find();
-        if($is_friend){
-            $this->success('success',array('money'=>'free'));
-        }
-
         //验证金额
         $wallet_info = Db::name('user_wallet')->where(['user_id' => $this->auth->id])->find();
         if ($wallet_info['vip_endtime'] >= time()) { //会员
@@ -605,7 +594,7 @@ $resArray['money'] = $money;  //返回给前端的计算结果
     //语音通话每分钟调用一次
     public function voice_onemin(){
         if ($this->auth->is_kefu == 1) { //我是客服或者对方是客服
-            $this->success('success');
+            $this->success('success',['money' => 'free']);
         }
         if ($this->auth->gender == 0) { //女生不花钱
            $this->error('您的网络开小差啦~');
@@ -619,7 +608,7 @@ $resArray['money'] = $money;  //返回给前端的计算结果
             $this->error('不存在的用户');
         }
         if ($to_user_info['is_kefu'] == 1) { //我是客服或者对方是客服
-            $this->success('success');
+            $this->success('success',['money' => 'free']);
         }
         if ($to_user_info['gender'] != 0) {
             $this->error('同性不能聊天~');
@@ -757,7 +746,7 @@ $resArray['money'] = $money;  //返回给前端的计算结果
     //视频通话每分钟调用一次
     public function videochat_onemin(){
         if ($this->auth->is_kefu == 1) { //我是客服或者对方是客服
-            $this->success('success');
+            $this->success('success',['money' => 'free']);
         }
         if ($this->auth->gender == 0) { //女生不花钱
             $this->error('您的网络开小差啦~');
@@ -771,7 +760,7 @@ $resArray['money'] = $money;  //返回给前端的计算结果
             $this->error('不存在的用户');
         }
         if ($to_user_info['is_kefu'] == 1) { //我是客服或者对方是客服
-            $this->success('success');
+            $this->success('success',['money' => 'free']);
         }
         if ($to_user_info['gender'] !=  0) {
             $this->error('同性不能聊天~');