Explorar el Código

:bug: 用户id 应该使用user_uid

visuddhinanda hace 3 años
padre
commit
3f2d42a73c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/Http/Api/ShareApi.php

+ 2 - 2
app/Http/Api/ShareApi.php

@@ -114,12 +114,12 @@ class ShareApi{
      * 获取对某个共享资源的权限
      * 获取对某个共享资源的权限
      */
      */
     public static function getResPower($user_uid,$res_id){
     public static function getResPower($user_uid,$res_id){
-            if($userid==='0'){
+            if(empty($user_uid)){
                 #未登录用户 没有共享资源
                 #未登录用户 没有共享资源
                 return 0;
                 return 0;
             }
             }
             # 找我加入的群
             # 找我加入的群
-            $my_group = Group::where("user_id",$user_uid)->select('group_id')->get();
+            $my_group = GroupMember::where("user_id",$user_uid)->select('group_id')->get();
             $userList[] = $user_uid;
             $userList[] = $user_uid;
             foreach ($my_group as $key => $value) {
             foreach ($my_group as $key => $value) {
                 $userList[]=$value["group_id"];
                 $userList[]=$value["group_id"];