| xqd
@@ -81,9 +81,10 @@ class DynamicService
|
|
|
}
|
|
|
|
|
|
$dynamic = DynamicModel::query();
|
|
|
- $dynamic = $dynamic->with(["user"=>function($query){
|
|
|
- $query->select('id','sex','is_vip','tencent_im_user_id');
|
|
|
- },'user_info']);
|
|
|
+// $dynamic = $dynamic
|
|
|
+// ->with(["user"=>function($query){
|
|
|
+// $query->select('id','sex','is_vip','tencent_im_user_id');
|
|
|
+// },'user_info']);
|
|
|
//查询条件
|
|
|
//类型 type 1全部 2附近
|
|
|
if($where['type']==2){
|
| xqd
@@ -91,21 +92,21 @@ class DynamicService
|
|
|
}
|
|
|
|
|
|
//性别
|
|
|
-// if($where['look_type']!=3){
|
|
|
-// $dynamic = $dynamic->whereHas('user',function($query)use($where){
|
|
|
-// $query->where('sex',$where['look_type'])->select();
|
|
|
-// });
|
|
|
-// }
|
|
|
-//
|
|
|
-// //用户id
|
|
|
-// if($where['user_id']!=0){
|
|
|
-// $dynamic = $dynamic->where('user_id','=',$where['user_id']);
|
|
|
-// }
|
|
|
-//
|
|
|
-// //标签
|
|
|
-// if($where['tag_id']!=0){
|
|
|
-// $dynamic = $dynamic->whereRaw('FIND_IN_SET(?,tag)',[$where['tag_id']]);
|
|
|
-// }
|
|
|
+ if($where['look_type']!=3){
|
|
|
+ $dynamic = $dynamic->whereHas('user',function($query)use($where){
|
|
|
+ $query->where('sex',$where['look_type'])->select();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //用户id
|
|
|
+ if($where['user_id']!=0){
|
|
|
+ $dynamic = $dynamic->where('user_id','=',$where['user_id']);
|
|
|
+ }
|
|
|
+
|
|
|
+ //标签
|
|
|
+ if($where['tag_id']!=0){
|
|
|
+ $dynamic = $dynamic->whereRaw('FIND_IN_SET(?,tag)',[$where['tag_id']]);
|
|
|
+ }
|
|
|
|
|
|
$dynamic = $dynamic->orderByDesc('id')
|
|
|
->paginate(request('perPage',20));
|