Просмотр исходного кода

APP/小程序-VR互转规则,增加大账号可转给任何人

sunxbiao 1 год назад
Родитель
Сommit
74e67730e7
1 измененных файлов с 19 добавлено и 21 удалено
  1. 19 21
      app/controller/api/store/merchant/Taskordervr.php

+ 19 - 21
app/controller/api/store/merchant/Taskordervr.php

@@ -69,37 +69,35 @@ class Taskordervr extends BaseController
69 69
             return json(['code'=>400,'msg'=>'获取用户失败,请重试!']);
70 70
         }
71 71
 
72
-        // 不同0号线团队之间 禁止转VR
73
-        $userZeroLineList = Db::name('user_zero_line')->where('status', '=', 1)->select()->toArray();
74
-        foreach ($userZeroLineList as $userZeroLine) {
75
-            //查询当前团队的用户列表
76
-            $sql = "select getUserLevelId({$userZeroLine['team_uid']}) as uids";
77
-            //\think\facade\Log::info("lplpDB".$sql);
78
-            try {
79
-                $spread_user_list = Db::query($sql);
80
-            } catch (\Exception $exception) {
81
-                return json($exception->getMessage());
82
-            }
83
-            $spread_user_list = explode(",", trim($spread_user_list[0]['uids'], '$,'));
84
-            if (in_array($uid, $spread_user_list) !== in_array($user_data['uid'], $spread_user_list)) {
85
-                return json(['code' => 400, 'msg' => '不同团队之间禁止互转VR!', 'data' => '']);
86
-            }
87
-        }
88
-
89
-
90 72
         if($user_data['uid'] == $udatas['uid']){
91 73
             return json(['code'=>400,'msg'=>'禁止付款账号和收款账号为同一人!','data'=>'']);
92 74
         }
93 75
 
94
-
95
-
96
-
97 76
         $yue_vr =  $udatas['vr'] - $vr;
98 77
 
99 78
         if($yue_vr < 0){
100 79
             return json(['code'=>400,'msg'=>'VR不足!']);
101 80
         }
102 81
 
82
+        if ($udatas['uid'] != 14) {
83
+            // 不同0号线团队之间 禁止转VR
84
+            $userZeroLineList = Db::name('user_zero_line')->where('status', '=', 1)->select()->toArray();
85
+            foreach ($userZeroLineList as $userZeroLine) {
86
+                //查询当前团队的用户列表
87
+                $sql = "select getUserLevelId({$userZeroLine['team_uid']}) as uids";
88
+                //\think\facade\Log::info("lplpDB".$sql);
89
+                try {
90
+                    $spread_user_list = Db::query($sql);
91
+                } catch (\Exception $exception) {
92
+                    return json($exception->getMessage());
93
+                }
94
+                $spread_user_list = explode(",", trim($spread_user_list[0]['uids'], '$,'));
95
+                if (in_array($uid, $spread_user_list) !== in_array($user_data['uid'], $spread_user_list)) {
96
+                    return json(['code' => 400, 'msg' => '不同团队之间禁止互转VR!', 'data' => '']);
97
+                }
98
+            }
99
+        }
100
+
103 101
         //return json(['code'=>400,'msg'=>$user_data['vr'] + $vr]);
104 102
         //支付s账号
105 103
         $user_res = Db::name("user")->where("uid",$uid)->update(['vr'=>$yue_vr]);