瀏覽代碼

debu调试

duqinya 5 年之前
父節點
當前提交
92486d68a5
共有 1 個文件被更改,包括 8 次插入19 次删除
  1. 8 19
      app/Repositories/BeanRepository.php

+ 8 - 19
app/Repositories/BeanRepository.php

@@ -4,6 +4,7 @@ use App\Models\Behavior;
 use App\Models\CommentRecord;
 use App\Models\GeneralRecord;
 use App\Models\Post;
+use App\Traits\UserTrait;
 use App\Models\RegisteredRecord;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Log;
@@ -11,6 +12,7 @@ use Tymon\JWTAuth\Facades\JWTAuth;
 use Illuminate\Support\Facades\Redis;
 class BeanRepository
 {
+    use UserTrait;
     public function beanDetail($request)
     {
         try {
@@ -141,9 +143,10 @@ class BeanRepository
                 }
             }
         }
-        $user_ids = array_column($excellent_residents,'content_author_id');
-       $content_author_id = array_unique($user_ids);
-        $author_data = $this->followDetail($content_author_id);
+        $content_author_id = array_column($excellent_residents,'content_author_id');
+        $uids = array_unique($content_author_id);
+        $author_data = $this->getFollowMembersStatus($uids);
+
         if (count($author_data)>0){
             foreach ($author_data as $key=>$val){
                 foreach ($excellent_residents as $k=>$v){
@@ -154,7 +157,8 @@ class BeanRepository
                     }
                 }
             }
-        }
+        }var_dump($uids);
+        var_dump($author_data);die;
 
         return $excellent_residents;
     }
@@ -174,19 +178,4 @@ class BeanRepository
         return $all_best_author;
 
     }
-
-   function followDetail($content_author_id)
-    {
-        try {
-            $sign = generateSign([], config('customer.app_secret'));
-            $url = config("customer.app_service_url").'/user/v2/member/getMemberIds';
-            $array = [
-                'json' => ['sign' => $sign, 'uids' => $content_author_id], 'query' => [], 'http_errors' => false,'headers'=>['Authorization'=>"Bearer ".JWTAuth::getToken()]
-            ];
-            return http($url,$array,'get');
-        } catch (\Exception $e) {
-            Log::debug("followDetail:".$e->getMessage());
-            return [];
-        }
-    }
 }