浏览代码

文字,语音,视频,不同会员的权限

lizhen_gitee 2 月之前
父节点
当前提交
09a4b1dcdc
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      application/api/controller/Usercenter.php

+ 10 - 3
application/api/controller/Usercenter.php

@@ -501,7 +501,7 @@ class Usercenter extends Api
         //验证金额
         $wallet_info = Db::name('user_wallet')->where('user_id',$this->auth->id)->find();
         $is_vip = $this->is_vip($wallet_info['vip_endtime'],$wallet_info['vip_level']);
-        if ($is_vip) { //会员
+        if ($is_vip != 0) { //会员
             $price = $to_user_info['chat_price'];//config('site.typing_min_price');  //扣费金币
             //获取折扣
             $vip_chat_discount = config('site.vip_chat_discount');
@@ -626,7 +626,11 @@ $resArray['money'] = $money;  //返回给前端的计算结果
         //验证金额
         $wallet_info = Db::name('user_wallet')->where('user_id',$this->auth->id)->find();
         $is_vip = $this->is_vip($wallet_info['vip_endtime'],$wallet_info['vip_level']);
-        if ($is_vip) { //会员
+        if($is_vip == 0){
+            $this->error('VIP才能语音聊天哦');
+        }
+
+        if ($is_vip == 2) { //SVIP会员
             $price = $to_user_info['voice_price'];//config('site.video_min_price');  //扣费金币
             //获取折扣
             $vip_voice_discount = config('site.vip_voice_discount');
@@ -800,7 +804,10 @@ $resArray['money'] = $money;  //返回给前端的计算结果
         //验证金额
         $wallet_info = Db::name('user_wallet')->where('user_id',$this->auth->id)->find();
         $is_vip = $this->is_vip($wallet_info['vip_endtime'],$wallet_info['vip_level']);
-        if ($is_vip) { //会员
+        if($is_vip != 2){
+            $this->error('SVIP才能视频聊天哦');
+        }
+        if ($is_vip == 2) { //SVIP会员
             $price = $to_user_info['video_price'];//config('site.video_min_price');  //扣费金币
             //获取折扣
             $vip_video_discount = config('site.vip_video_discount');