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

更新小程序获取手机号绑定接口

吴昊天 2 лет назад
Родитель
Сommit
6b3838600f
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      crmeb/app/api/route/v2.php
  2. 2 2
      crmeb/app/services/wechat/RoutineServices.php

+ 2 - 2
crmeb/app/api/route/v2.php

@@ -35,9 +35,9 @@ Route::group('v2', function () {
         //是否强制绑定手机号
         Route::get('bind_status', 'v2.PublicController/bindPhoneStatus');
         //小程序授权绑定手机号
-        Route::post('auth_bindind_phone', 'v2.wechat.AuthController/bindingPhone');
+        Route::post('auth_bindind_phone', 'v2.wechat.AuthController/authBindingPhone');
         //小程序授权后绑定手机号
-        Route::post('routine/binding_phone', 'v2.wechat.AuthController/authBindingPhone');
+        Route::post('routine/binding_phone', 'v2.wechat.AuthController/BindingPhone');
         //小程序手机号登录直接绑定
         Route::post('phone_silence_auth', 'v2.wechat.AuthController/silenceAuthBindingPhone');
         //微信手机号登录直接绑定

+ 2 - 2
crmeb/app/services/wechat/RoutineServices.php

@@ -481,10 +481,10 @@ class RoutineServices extends BaseServices
         }
         $uid = app()->make(WechatUserServices::class)->openidTouid($userInfoCong['openid']);
         $userServices = app()->make(UserServices::class);
-        if ($userServices->count(['phone|account' => $userInfo['purePhoneNumber']])) {
+        if ($userServices->count(['phone' => $userInfo['purePhoneNumber']])) {
             throw new ApiException(410028);
         }
-        $res = app()->make(UserServices::class)->update(['id' => $uid], ['phone' => $userInfo['purePhoneNumber']]);
+        $res = app()->make(UserServices::class)->update(['uid' => $uid], ['phone' => $userInfo['purePhoneNumber']]);
         if ($res) return true;
         throw new ApiException(410017);
     }