DESKTOP-2STQMTS\Administrator 3 years ago
parent
commit
0841fd89d4
1 changed files with 6 additions and 6 deletions
  1. 6 6
      app/Http/Controllers/Api/UserController.php

+ 6 - 6
app/Http/Controllers/Api/UserController.php

@@ -82,7 +82,7 @@ class UserController extends FrontController
      */
     function setRecord(){
         $s_code = request()->input('s_code', '');//上级推广码
-        $t_code = request()->input('t_code', '');//浏览者的推广码
+        $m_id = request()->input('m_id', '');//浏览者
 
         if(empty($s_code) || empty($t_code)) return $this->apiResponseSuccess('完成');
         //检查上级是否存在
@@ -95,16 +95,16 @@ class UserController extends FrontController
         }
 
         //检查浏览者是否存在
-        $t_user = WxUser::where('invite_code', $t_code)->select(['id'])->first();
-        if($t_user){
+        $user = WxUser::where('id', $m_id)->select(['id'])->first();
+        if($user){
             //检查这个浏览者是否浏览过这个上级的
-            $info = WxRecord::where('s_code',$s_code)->where('t_code',$t_code)->select(['id'])->first();
+            $info = WxRecord::where('s_code',$s_code)->where('m_id',$m_id)->select(['id'])->first();
             if(empty($info)){
                 $s_user->increment('uv');//记录uv量
 
                 WxRecord::create([
                     's_code' => $s_code,
-                    't_code' => $t_code,
+                    'm_id' => $m_id,
                 ]);
             }
         }
@@ -198,7 +198,7 @@ class UserController extends FrontController
 
         $info = WxUser::where('phone', $phone)->select(['id'])->first();
         if ($info) {
-            return $this->apiResponseError( '该号码已申请');
+            return $this->apiResponseError( '该号码已提交');
         }
 
         //获取用户上级