wesmiler %!s(int64=2) %!d(string=hai) anos
pai
achega
e1f1cb0fb6
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      app/Services/Api/MessageService.php

+ 3 - 3
app/Services/Api/MessageService.php

@@ -431,7 +431,7 @@ class MessageService extends BaseService
         if (RedisService::exists($cacheKey)) {
             return $data;
         }
-        $where = ['to_uid' => $userId, 'status' => 1, 'is_read' => 2, 'mark' => 1];
+        $where = ['to_uid' => $userId,'to_show'=>1, 'status' => 1, 'is_read' => 2, 'mark' => 1];
         if ($type > 0) {
             $where['type'] = $type;
         }
@@ -516,7 +516,7 @@ class MessageService extends BaseService
     public function setHide($userId, $type)
     {
         $this->model->where(['to_uid' => $userId, 'type' => $type, 'status' => 1, 'mark' => 1])
-            ->update(['update_time' => time(), 'is_read' => 1, 'status' => 3]);
+            ->update(['update_time' => time(),'to_show'=>2, 'is_read' => 1, 'status' => 3]);
 
         // 清除缓存
         RedisService::keyDel("caches:messages:bar*");
@@ -589,7 +589,7 @@ class MessageService extends BaseService
             // 聊天消息发给我的,接收方全隐藏
             $this->model->where(function($query) use($userId){
                 $query->where(['type'=>9,'to_uid'=> $userId,'mark'=>1]);
-            })->update(['update_time' => time(), 'to_show' => 2]);
+            })->update(['update_time' => time(),'is_read'=>1, 'to_show' => 2]);
         }
 
         return true;