|
@@ -360,6 +360,11 @@ class PostRepositories
|
|
|
->join('post_data', 'post_data.post_id', '=', 'post.id')
|
|
|
->select('post.*', DB::raw("IF (post.id = {$id},1,0) as sort"))
|
|
|
->where($where)
|
|
|
+ ->where(function($query) use ($request){
|
|
|
+ if(isset($request['topic_id']) && $request['topic_id']){
|
|
|
+ $query->whereRaw('FIND_IN_SET('.$request['topic_id'].', post.topic_ids)');
|
|
|
+ }
|
|
|
+ })
|
|
|
->orderBy('sort', 'desc')
|
|
|
->orderBy('weight','desc')
|
|
|
->paginate($perPage);
|