|
@@ -11,6 +11,7 @@ namespace App\Repositories\Post;
|
|
|
|
|
|
use App\Models\Behavior;
|
|
|
use App\Models\CategoryTopic;
|
|
|
+use App\Models\MemberFollowTopic;
|
|
|
use App\Models\Post;
|
|
|
use App\Models\PostComment;
|
|
|
use App\Models\PostData;
|
|
@@ -47,6 +48,7 @@ class PostRepository
|
|
|
RabbitMqUtil $rabbitMqUtil,
|
|
|
Behavior $behavior,
|
|
|
CategoryTopic $categoryTopic,
|
|
|
+ MemberFollowTopic $memberFollowTopic,
|
|
|
PostStatistics $postStatistics,
|
|
|
PostStore $postStore,
|
|
|
PostStoreImgs $postStoreImgs,
|
|
@@ -60,6 +62,7 @@ class PostRepository
|
|
|
$this->rabbitMqUtil = $rabbitMqUtil;
|
|
|
$this->behavior = $behavior;
|
|
|
$this->categoryTopic = $categoryTopic;
|
|
|
+ $this->memberFollowTopic = $memberFollowTopic;
|
|
|
$this->topic = $topic;
|
|
|
$this->postStatistics = $postStatistics;
|
|
|
$this->postStore = $postStore;
|
|
@@ -603,6 +606,23 @@ class PostRepository
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取关注分类用户uids
|
|
|
+ */
|
|
|
+ public function getCategoryUids($request)
|
|
|
+ {
|
|
|
+ $categoryIds = json_decode($request['category'], true);
|
|
|
+ $topicIds = $this->categoryTopic->whereIn('category_id', $categoryIds)->pluck('topic_id')->toArray();
|
|
|
+ $uids = $this->memberFollowTopic->whereIn('topic_id', $topicIds)->pluck('uid')->toArray();
|
|
|
+ $uids = array_unique($uids);
|
|
|
+ sort($uids);
|
|
|
+ return Response::create([
|
|
|
+ 'message' => '成功',
|
|
|
+ 'status_code' => 200,
|
|
|
+ 'data' => $uids
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 评论列表
|
|
|
*/
|