wzq 5 年 前
コミット
60745066ce
共有1 個のファイルを変更した6 個の追加1 個の削除を含む
  1. 6 1
      app/Http/Controllers/V1/PostController.php

+ 6 - 1
app/Http/Controllers/V1/PostController.php

@@ -134,7 +134,12 @@ class PostController extends Controller
             Log::info('获取用户信息失败');
             return jsonError('获取用户信息失败');
         }
-        $list = $this->postRepositories->myPost($request['type'], $userInfo['uid']);
+        if(isset($request['uid'])){
+            $uid = $request['uid'];
+        }else{
+            $uid = $userInfo['uid'];
+        }
+        $list = $this->postRepositories->myPost($request['type'], $uid);
         $fractal = new Manager();
         $resource = new Collection($list, new MyTransformer());
         $resource->setPaginator(new IlluminatePaginatorAdapter($list));