wesmiler 2 роки тому
батько
коміт
3f2b75ebab
1 змінених файлів з 8 додано та 0 видалено
  1. 8 0
      app/Services/Api/MessageService.php

+ 8 - 0
app/Services/Api/MessageService.php

@@ -88,6 +88,14 @@ class MessageService extends BaseService
 
 
                 if ($type != 9) {
                 if ($type != 9) {
                     $query->where('a.to_uid', $userId);
                     $query->where('a.to_uid', $userId);
+                }else {
+                    $query->where(function ($query) use ($userId) {
+                        $query->where(function($query) use($userId){
+                            $query->where(['a.from_uid' => $userId,'a.from_show'=>1]);
+                        })->orWhere(function($query) use($userId){
+                            $query->where(['a.to_uid' => $userId,'a.to_show'=>1]);
+                        });
+                    });
                 }
                 }
 
 
                 $chatType = isset($params['chat_type']) ? intval($params['chat_type']) : 0;
                 $chatType = isset($params['chat_type']) ? intval($params['chat_type']) : 0;