LiuJ há 14 horas atrás
pai
commit
d548ca86f8
1 ficheiros alterados com 1 adições e 266 exclusões
  1. 1 266
      app/JsonRpc/NewsService.php

+ 1 - 266
app/JsonRpc/NewsService.php

@@ -4103,272 +4103,7 @@ class NewsService implements NewsServiceInterface
     $result = Notice::where('id', $data['id'])->delete();
     return Result::success($result);
   }
-  public function c(array $data): array
-  {
-    $type_id = isset($data['type_id']) ? $data['type_id'] : 1;
-    // '1:个人会员 2:政务会员 3:企业会员 4:调研员 10000:管理员 20000:游客(小程序)
-    $user_id = isset($data['user_id']) ? $data['user_id'] : 0; //用户id
-    $result = [];
-    if ($type_id == 1) {
-      //最近的5篇已审的文章
-      $apply_articale = Article::where('status', 1)
-        ->where('admin_user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条单聊未读聊天消息
-      $chat = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 1)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条未读群聊信息
-      $chat_group = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 2)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的已审核商品
-      $good = Good::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户待审核的公告
-      $notice = Notice::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的待审核投诉
-      $complaint = Complaint::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的book
-      $book = Book::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的求职
-      //获取5条用户的求职 1
-      $job_hunting = JobHunting::where('job_hunting.status', 1)
-        ->where('job_hunting.user_id', $user_id)
-        ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_hunting.website_id', '=', 'website.id')
-        ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的求职 2
-      $job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
-        ->where('job_recruiting.user_id', $user_id)
-        ->leftJoin('user', 'job_recruiting.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_recruiting.website_id', '=', 'website.id')
-        ->select('job_recruiting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //人才库  1
-      $job_apply = JobApply::where('job_apply.status', 1)
-        ->where('job_apply.receiver_id', $user_id)
-        ->leftJoin('user', 'job_apply.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_apply.website_id', '=', 'website.id')
-        ->leftJoin('job_company', 'job_company.job_id', '=', 'job_apply.recruit_id')
-        ->leftJoin('job_recruiting', 'job_recruiting.id', '=', 'job_apply.recruit_id')
-        ->select('job_recruiting', 'job_recruiting.', '', '')
-        ->select('job_apply.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name', 'job_recruiting.title as job_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      // 职场机会 2
-      $job_resume = JobResume::where('job_resume.status', 1)
-        ->where('job_resume.receiver_id', $user_id)
-        ->leftJoin('user', 'job_resume.receiver_id', '=', 'user.id')
-        ->leftJoin('website', 'job_resume.website_id', '=', 'website.id')
-        ->leftJoin('job_company', 'job_company.job_id', '=', 'job_resume.recruit_id')
-        ->select('job_resume.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      // count($chat) + count($chat_group) +
-      $count = count($apply_articale) + count($good) + count($notice) + count($complaint) + count($book) + count($job_hunting) + count($job_recruiting) + count($job_apply) + count($job_resume);
-      $result = [
-        'apply_articale' => $apply_articale,
-        'chat' => $chat,
-        'chat_group' => $chat_group,
-        'good' => $good,
-        'notice' => $notice,
-        'complaint' => $complaint,
-        'book' => $book,
-        'job_hunting' => $job_hunting,
-        'job_recruiting' => $job_recruiting,
-        'job_apply' => $job_apply,
-        'job_resume' => $job_resume,
-        'count' => $count,
-      ];
-    } elseif ($type_id == 2) {
-      //最近的5篇已审的文章
-      $apply_articale = Article::where('status', 1)
-        ->where('admin_user_id', $user_id)
-        ->limit(5)->get();
-      //获取5条单聊未读聊天消息
-      $chat = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 1)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条未读群聊信息
-      $chat_group = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 2)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的已审核商品
-      $good = Good::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //count($chat) + count($chat_group) 
-      $count = count($apply_articale) + count($good);
-      $result = [
-        'apply_articale' => $apply_articale,
-        'chat' => $chat,
-        'chat_group' => $chat_group,
-        'good' => $good,
-        'count' => $count,
-      ];
-    } elseif ($type_id == 3) {
-      //最近的5篇已审的文章
-      $apply_articale = Article::where('status', 1)
-        ->where('admin_user_id', $user_id)
-        ->limit(5)->get();
-      //获取5条单聊未读聊天消息
-      $chat = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 1)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条未读群聊信息
-      $chat_group = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 2)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的已审核商品
-      $good = Good::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-
-      //count($chat) + count($chat_group) +
-      $count =  count($apply_articale) + count($good);
-      $result = [
-        'apply_articale' => $apply_articale,
-        'chat' => $chat,
-        'chat_group' => $chat_group,
-        'good' => $good,
-        'count' => $count,
-      ];
-    } elseif ($type_id == 4) {
-      //最近的5篇已审的文章
-      $apply_articale = Article::where('status', 1)
-        ->where('admin_user_id', $user_id)
-        ->limit(5)->get();
-
-      //获取5条用户的已审核商品
-      $good = Good::where('status', 2)
-        ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      $count =  count($apply_articale) + count($good);
-      $result = [
-        'apply_articale' => $apply_articale,
-        'chat' => '',
-        'chat_group' => '',
-        'good' => $good,
-        'count' => $count,
-      ];
-    } elseif ($type_id == 10000) {
-      //获取未审核的5篇文章
-      $apply_articale = Article::where('status', 0)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条单聊未读聊天消息
-      $chat = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 1)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条未读群聊信息
-      $chat_group = ChatRecords::where('is_read', 0)
-        ->where('user_id', $user_id)
-        ->where('talk_type', 2)
-        ->orderBy('created_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的已审核商品
-      $good = Good::where('status', 1)
-        // ->where('user_id', $user_id)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户待审核的公告
-      $notice = Notice::where('status', 1)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的待审核投诉
-      $complaint = Complaint::where('status', 1)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的book
-      $book = Book::where('status', 1)
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的求职 1
-      $job_hunting = JobHunting::where('job_hunting.status', 1)
-        ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_hunting.website_id', '=', 'website.id')
-        ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //获取5条用户的求职 2
-      $job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
-        ->leftJoin('user', 'job_recruiting.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_recruiting.website_id', '=', 'website.id')
-        ->select('job_recruiting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      //人才库  1
-      $job_apply = JobApply::where('job_apply.status', 1)
-        ->leftJoin('user', 'job_apply.user_id', '=', 'user.id')
-        ->leftJoin('website', 'job_apply.website_id', '=', 'website.id')
-        ->leftJoin('job_company', 'job_company.job_id', '=', 'job_apply.recruit_id')
-        ->leftJoin('job_recruiting', 'job_recruiting.id', '=', 'job_apply.recruit_id')
-        ->select('job_apply.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name', 'job_recruiting.title as job_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
-      // 职场机会 2
-      $job_resume =
-        JobResume::where('job_resume.status', 1)
-        ->leftJoin('user', 'job_resume.receiver_id', '=', 'user.id')
-        ->leftJoin('website', 'job_resume.website_id', '=', 'website.id')
-        ->leftJoin('job_company', 'job_company.job_id', '=', 'job_resume.recruit_id')
-        ->select('job_resume.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name')
-        ->orderBy('updated_at', 'desc')
-        ->limit(5)->get();
 
-      $count = count($chat) + count($chat_group) + count($apply_articale) + count($good) + count($notice) + count($complaint) + count($book) + count($job_hunting) + count($job_recruiting) + count($job_apply) + count($job_resume);
-      $result = [
-        'apply_articale' => $apply_articale,
-        'chat' => $chat,
-        'chat_group' => $chat_group,
-        'good' => $good,
-        'notice' => $notice,
-        'complaint' => $complaint,
-        'book' => $book,
-        'job_hunting' => $job_hunting,
-        'job_recruiting' => $job_recruiting,
-        'job_apply' => $job_apply,
-        'job_resume' => $job_resume,
-        'count' => $count,
-      ];
-    } elseif ($type_id == 20000) {
-    }
-    var_dump($type_id, '-----------------test---------');
-    return Result::success($result);
-  }
   public function getComplaintList(array $data): array
   {
     var_dump($data, '00000001000000000000');
@@ -5401,7 +5136,7 @@ class NewsService implements NewsServiceInterface
   //20250422  书刊音像
   public function addBook(array $data): array
   {
-    // $user_id = $data['user_id'] ?? 0;
+    $user_id = $data['user_id'] ?? 0;
     $type_id = $data['type_id'] ?? 0;
     // $website_id = $data['website_id'] ?? 0;
     // unset($data['user_id']);