LiuJ 5 ay önce
ebeveyn
işleme
3c24042a8f
1 değiştirilmiş dosya ile 38 ekleme ve 38 silme
  1. 38 38
      app/JsonRpc/NewsService.php

+ 38 - 38
app/JsonRpc/NewsService.php

@@ -4385,7 +4385,7 @@ class NewsService implements NewsServiceInterface
     $user_id = isset($data['user_id']) ? $data['user_id'] : '';
     $where = [];
     if ($type_id != 10000 && empty($data['deal_user'])) {
-      $where['complaint.user_id'] = $user_id;
+      // $where['complaint.user_id'] = $user_id;
     }
     if (!empty($data['title'])) {
       $where[] = ['complaint.title', 'like', '%' . $data['title'] . '%'];
@@ -4461,13 +4461,13 @@ class NewsService implements NewsServiceInterface
       ->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);
-        });
-      })
+      // ->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')
@@ -6797,36 +6797,36 @@ class NewsService implements NewsServiceInterface
    */
   public function getWebsiteCompanyList(array $data): array
   {
-     $where['website_id'] = $data['website_id'];
-        $where['status'] = 1;
-        $categoryIds = [];
-        if(isset($data['category_id']) && !empty($data['category_id'])){
-          
-          $category_id = $data['category_id'];
-        }
-        $category_arr = $this->processArticlePro($data['website_id']);
-        $categoryIds = $category_arr['categoryIds'];
-        // return Result::success($cat_1st_arr);
-        $company = Company::when(isset($data['keyword']) && !empty($data['keyword']), function($query) use ($data){
-            $query->where('title', 'like', '%' . $data['keyword'] . '%');
-          })
-          ->when(!isset($category_id) || empty($category_id), function($query) use ($categoryIds){
-            $query->whereIn('category_id', $categoryIds);
-          })
-          ->when(isset($data['category_id']) && !empty($data['category_id']), function($query) use ($category_id){
-            $query->where('category_id', $category_id);
-          })
-          ->select('id','title','introduce','description','content','category_id','cat_arr_id','updated_at')  
-          ->orderBy('updated_at', 'desc')
-          ->paginate($data['pageSize'], ['*'], 'page', $data['page']);
-        if(empty($company)){
-            return Result::error("暂无相关公司信息", 0);
-        }
-        $result = [
-            'count' => $company->total(),
-            'data' => $company->items(), // 使用 items() 方法替代不存在的 data() 方法
-        ];
-        return Result::success($result);
+    $where['website_id'] = $data['website_id'];
+    $where['status'] = 1;
+    $categoryIds = [];
+    if (isset($data['category_id']) && !empty($data['category_id'])) {
+
+      $category_id = $data['category_id'];
+    }
+    $category_arr = $this->processArticlePro($data['website_id']);
+    $categoryIds = $category_arr['categoryIds'];
+    // return Result::success($cat_1st_arr);
+    $company = Company::when(isset($data['keyword']) && !empty($data['keyword']), function ($query) use ($data) {
+      $query->where('title', 'like', '%' . $data['keyword'] . '%');
+    })
+      ->when(!isset($category_id) || empty($category_id), function ($query) use ($categoryIds) {
+        $query->whereIn('category_id', $categoryIds);
+      })
+      ->when(isset($data['category_id']) && !empty($data['category_id']), function ($query) use ($category_id) {
+        $query->where('category_id', $category_id);
+      })
+      ->select('id', 'title', 'introduce', 'description', 'content', 'category_id', 'cat_arr_id', 'updated_at')
+      ->orderBy('updated_at', 'desc')
+      ->paginate($data['pageSize'], ['*'], 'page', $data['page']);
+    if (empty($company)) {
+      return Result::error("暂无相关公司信息", 0);
+    }
+    $result = [
+      'count' => $company->total(),
+      'data' => $company->items(), // 使用 items() 方法替代不存在的 data() 方法
+    ];
+    return Result::success($result);
   }
   /**
    * 获取项目列表