LiuJ пре 5 месеци
родитељ
комит
40714cbbec
1 измењених фајлова са 23 додато и 0 уклоњено
  1. 23 0
      app/JsonRpc/NewsService.php

+ 23 - 0
app/JsonRpc/NewsService.php

@@ -7238,6 +7238,25 @@ class NewsService implements NewsServiceInterface
         ->orderBy('updated_at', 'desc')
         // ->limit(5)
         ->get();
+      //获取 被通知者未读信息
+      $notice_unread = Notice::where('status', 2)
+        ->whereJsonContains('re_user_ids', $user_id)
+        //未读消息
+        ->where(function ($query) use ($user_id) {
+          $query->whereJsonDoesntContain('read_id', $user_id)
+            ->orWhereNull('read_id');
+        })
+        ->get();
+      $complaint_unread = Complaint::where('status', 2)
+        ->whereJsonContains('re_user_ids', $user_id)
+        //未读消息
+        ->where(function ($query) use ($user_id) {
+          $query->whereJsonDoesntContain('read_id', $user_id)
+            ->orWhereNull('read_id');
+        })
+        ->get();
+
+
       //获取5条用户的yijing审核公司 :0:未审核;1:已审核;2:已拒绝
 
       $complany = Company::where('status', 1)
@@ -7279,6 +7298,8 @@ class NewsService implements NewsServiceInterface
       $count = count($apply_articale) + count($good) + count($notice) + count($complaint) + count($book) + count($job_hunting) + count($job_recruiting) + count($job_apply) + count($job_resume) + count($complaint_deal)
         + count($complany)
         + count($project)
+        + count($notice_unread)
+        + count($complaint_unread)
         // + count($chat) + count($chat_group)
       ;
       $result = [
@@ -7296,6 +7317,8 @@ class NewsService implements NewsServiceInterface
         'complaint_deal' => $complaint_deal,
         'complany' => $complany,
         'project' => $project,
+        'notice_unread' => $notice_unread,
+        'complaint_unread' => $complaint_unread,
         'count' => $count,
       ];
     } elseif ($type_id == 12) {