Explorar o código

APP小程序-注册登录功能改进-绑定邀请人

xupuyuan hai 11 meses
pai
achega
77993f8d5d
Modificáronse 2 ficheiros con 2 adicións e 5 borrados
  1. 1 4
      app/controller/api/Auth.php
  2. 1 1
      route/api.php

+ 1 - 4
app/controller/api/Auth.php

@@ -569,23 +569,20 @@ class Auth extends BaseController
569 569
         }
570 570
         $uid = $user->uid;
571 571
 
572
-        // 检查推荐人手机号是否传入
573 572
         if (empty($data['spread_phone'])) {
574 573
             return app('json')->fail('推荐人手机号不能为空');
575 574
         }
576 575
 
577
-        // 查找推荐人用户
578 576
         $spread_user = $repository->accountByUser($data['spread_phone']);
579 577
         if (!$spread_user) {
580 578
             return app('json')->fail('推荐人手机号不存在');
581 579
         }
582 580
 
583
-        // 防止绑定自己为推荐人
584 581
         if ($spread_user['uid'] == $uid) {
585 582
             return app('json')->fail('不能绑定自己为推荐人');
586 583
         }
587 584
 
588
-        // 执行绑定
585
+
589 586
         $repository->bindSpread($user, intval($spread_user['uid']));
590 587
 
591 588
         return app('json')->success('绑定成功');

+ 1 - 1
route/api.php

@@ -944,7 +944,7 @@ Route::group('api/', function () {
944 944
     //短信注册
945 945
     Route::post('auth/register', 'api.Auth/register');
946 946
     //绑定邀请人
947
-    Route::get('auth/bindSpread', 'api.Auth/bindSpread');
947
+    Route::post('auth/bindSpread', 'api.Auth/bindSpread');
948 948
     //测试账号
949 949
     Route::post('auth/register_all', 'api.Auth/register_all');
950 950
     //java商户端调用用户注册