LiuJ 5 месяцев назад
Родитель
Сommit
7c337cf5e6
2 измененных файлов с 109 добавлено и 0 удалено
  1. 102 0
      app/JsonRpc/NewsService.php
  2. 7 0
      app/JsonRpc/NewsServiceInterface.php

+ 102 - 0
app/JsonRpc/NewsService.php

@@ -4049,6 +4049,16 @@ class NewsService implements NewsServiceInterface
     }
   }
   public function getNoticeInfo(array $data): array
+  {
+    $result = Notice::where('id', $data['id'])->first();
+    // var_dump($result['re_user_ids'], '--------------------');
+    if (empty($result)) {
+      return Result::error("查询失败", 0);
+    }
+
+    return Result::success($result);
+  }
+  public function noticeList(array $data): array
   {
     $result = Notice::where('id', $data['id'])->first();
     // var_dump($result['re_user_ids'], '--------------------');
@@ -4080,6 +4090,7 @@ class NewsService implements NewsServiceInterface
     }
     return Result::success($result);
   }
+
   public function addNotice(array $data): array
   {
     date_default_timezone_set('Asia/Shanghai');
@@ -4149,6 +4160,8 @@ class NewsService implements NewsServiceInterface
     $result = Notice::where('id', $data['id'])->update($data);
     return Result::success($result);
   }
+
+
   public function getNoticeList(array $data): array
   {
     $where = [];
@@ -4249,7 +4262,61 @@ class NewsService implements NewsServiceInterface
     $result = Notice::where('id', $data['id'])->delete();
     return Result::success($result);
   }
+  public function complaintlist(array $data): array
+  {
+    $type_id = isset($data['type_id']) ? $data['type_id'] : '';
+    unset($data['type_id']);
+    $user_id = isset($data['user_id']) ? $data['user_id'] : '';
+    $where = [];
+    if ($type_id != 10000 && empty($data['deal_user'])) {
+      $where['complaint.user_id'] = $user_id;
+    }
+    if (!empty($data['title'])) {
+      $where[] = ['complaint.title', 'like', '%' . $data['title'] . '%'];
+    }
+    if (!empty($data['department_id'])) {
+      $where['complaint.department_id'] =   $data['department_id'];
+    }
+    if (!empty($data['deal'])) {
+      $where['complaint.deal'] =   $data['deal'];
+    }
+    if (!empty($data['status'])) {
+      $where['complaint.status'] =  $data['status'];
+    }
+    var_dump(!empty($data['deal_user']), '----------1');
+    var_dump($where, '----------2');
+    $result = Complaint::where($where)
+      ->when(!empty($data['status1']), function ($query) use ($data) {
+        $query->whereIn('complaint.status', [1, 3]);   //1待审核2已审核3已拒绝
+      })
+      ->when(!empty($data['deal_user'])  &&  $type_id != 10000, function ($query) use ($data) {
+        //json  re_user_ids   data[user_id]是不是在里面 
+        $query->Where(function ($q) use ($data) {
+          $q->whereRaw('JSON_CONTAINS(complaint.re_user_ids, \'' . $data['user_id'] . '\')')
+            ->where('complaint.status', 2);
+        });
+      })
+      ->leftJoin('department', 'complaint.department_id', '=', 'department.id')
+      // ->leftJoin('user', 'complaint.user_id', '=', 'user.id')
+      ->leftJoin('district', 'district.id', '=', 'complaint.city_id')
+      ->select('complaint.*', 'department.name as department_name', 'district.name as cityname')
+      ->orderBy('updated_at', 'desc')
+      ->paginate($data['page_size'], ['*'], 'page', $data['page']);
+    //sql输出
+
+    if (empty($result)) {
+      return Result::error("暂无投诉信息", 0);
+    }
+    // 取出数据
+    $rows = $result->items();
+    $count = $result->total();
 
+    $responseData = [
+      'rows' => $rows,
+      'count' => $count,
+    ];
+    return Result::success($responseData);
+  }
   public function getComplaintList(array $data): array
   {
     var_dump($data, '00000001000000000000');
@@ -4307,6 +4374,14 @@ class NewsService implements NewsServiceInterface
     return Result::success($responseData);
   }
   public function getComplaintInfo(array $data): array
+  {
+    $result = Complaint::where('id', $data['id'])->first();
+    if (empty($result)) {
+      return Result::error("查询失败", 0);
+    }
+    return Result::success($result);
+  }
+  public function readComplaint(array $data): array
   {
     $result = Complaint::where('id', $data['id'])->first();
     if (empty($result)) {
@@ -4334,6 +4409,7 @@ class NewsService implements NewsServiceInterface
     }
     return Result::success($result);
   }
+
   public function addComplaint(array $data): array
   {
     date_default_timezone_set('Asia/Shanghai');
@@ -5417,6 +5493,18 @@ class NewsService implements NewsServiceInterface
     ];
     return Result::success($result);
   }
+  public function readJobApply(array $data): array
+  {
+    $result = JobApply::where('id', $data['id'])->first();
+    if (empty($result)) {
+      return Result::error("查询失败", 0);
+    }
+    $result = JobApply::where('id', $data['id'])->update([
+      'status' => 2,
+    ]);
+    return Result::success($result);
+  }
+
   /*
     * 获取招聘信息列表-职场机会(个人会员收到企业推送岗位)
     * */
@@ -5558,6 +5646,20 @@ class NewsService implements NewsServiceInterface
     $result['count'] = $count;
     return Result::success($result);
   }
+
+  public function readJobResume(array $data): array
+  {
+    $result = JobResume::where('id', $data['id'])->first();
+    if (empty($result)) {
+      return Result::error("查询失败", 0);
+    }
+
+    $result = JobResume::where('id', $data['id'])->update([
+      'status' => 2,
+    ]);
+    return Result::success($result);
+  }
+
   // 20250306 招聘
   //20250422  书刊音像
   public function addBook(array $data): array

+ 7 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -453,4 +453,11 @@ interface NewsServiceInterface
      */
     public function getWebsiteCategoryJob(array $data): array;
     public function getArticleCommend(array $data): array;
+
+    public function noticeList(array $data): array;
+    public function complaintList(array $data): array;
+    public function readComplaint(array $data): array;
+    public function readJobResume(array $data): array;
+    public function readJobApply(array $data): array;
+    public function readNotice(array $data): array;
 }