Browse Source

搜索投票

15313670163 3 tháng trước cách đây
mục cha
commit
3aeb1ba41b
4 tập tin đã thay đổi với 137 bổ sung6 xóa
  1. 24 5
      app/JsonRpc/NewsService.php
  2. 0 0
      runtime/container/scan.cache
  3. 1 1
      runtime/hyperf.pid
  4. 112 0
      runtime/logs/hyperf.log

+ 24 - 5
app/JsonRpc/NewsService.php

@@ -615,15 +615,34 @@ class NewsService implements NewsServiceInterface
      */
     public function getSurveyList(array $data): array
     {
-        $result = Article::where('is_survey',1)
-        // ->select('id','survey_id','survey_type')
-        ->orderByDesc('updated_at')
+        $where = [];
+        if(isset($data['survey_name']) &&!empty($data['survey_name'])){
+            array_push($where,['survey_name','like','%'.$data['survey_name'].'%']);
+        }
+        if(isset($data['survey_type']) && $data['survey_type'] != null){
+            array_push($where,['survey_type','=',$data['survey_type']]);
+        }
+        if(isset($data['is_survey']) && $data['is_survey'] != null){
+            array_push($where,['is_survey','=',$data['is_survey']]);
+        }
+        // return Result::success($where);
+        if(!empty($where)){
+            $query = Article::where($where)->whereNotNull('survey_name');
+        }else{
+            $query = Article::whereNotNull('survey_name');
+        }
+        $count = $query->count();
+        $survey = $query->orderByDesc('id')
         ->limit($data['pageSize'])
         ->offset(($data['page']-1)*$data['pageSize'])
         ->get();
-        if(empty($result)){
-            return Result::error("暂无调查问卷",0);
+        if(empty($survey->toArray())){
+            return Result::error("暂无调查问卷!",0);
         }
+        $result = [
+            'rows'=>$survey,
+            'count'=>$count
+        ];
         return Result::success($result);
     }
     /**

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
runtime/container/scan.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-15871
+34601

+ 112 - 0
runtime/logs/hyperf.log

@@ -2492,3 +2492,115 @@
 [2025-02-27T13:30:29.444940+08:00] sql.INFO: [13.12] select `article_survey`.*, `article`.`survey_type` from `article_survey` left join `article` on `article_survey`.`art_id` = `article`.`id` where (`sur_id` = '2025022108311143717588') and `is_other` = '0' [] []
 [2025-02-27T13:30:29.466507+08:00] sql.INFO: [2.93] select * from `article_survey` where (`sur_id` = '2025022108311143717588') and `is_other` = '1' and `other_id` = '0' limit 1 [] []
 [2025-02-27T13:30:29.469976+08:00] sql.INFO: [2.65] select * from `article_survey` where (`sur_id` = '2025022108311143717588') and `is_other` = '1' and `other_id` != '0' order by `created_at` desc limit 1 [] []
+[2025-02-27T14:21:44.372283+08:00] sql.INFO: [43.49] select * from `article` where `is_survey` = '1' order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:24:40.758086+08:00] sql.INFO: [40.48] select * from `article` where (`is_survey` = 'is not') order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:25:21.295226+08:00] sql.INFO: [13.88] select * from `article` where (`survey_name` = 'AXX' and `is_survey` = 'is not') order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:25:22.497285+08:00] sql.INFO: [11.81] select * from `article` where (`survey_name` = 'AXX' and `is_survey` = 'is not') order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:25:28.904091+08:00] sql.INFO: [17.86] select * from `article` where (`is_survey` = 'is not') order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:33:11.603533+08:00] sql.INFO: [27.42] select * from `article` where `is_survey` is not null order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:34:57.696109+08:00] sql.INFO: [20.91] select * from `article` where `is_survey` is not null order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:34:58.483045+08:00] sql.INFO: [17.63] select * from `article` where `is_survey` is not null order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:34:59.145041+08:00] sql.INFO: [33.56] select * from `article` where `is_survey` is not null order by `updated_at` desc limit 10 offset 0 [] []
+[2025-02-27T14:35:03.358661+08:00] sql.INFO: [15.41] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:00.051888+08:00] sql.INFO: [18.71] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:02.125267+08:00] sql.INFO: [19.48] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:02.965257+08:00] sql.INFO: [16.63] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:03.657353+08:00] sql.INFO: [16.2] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:04.301692+08:00] sql.INFO: [17.74] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:36:52.385856+08:00] sql.INFO: [18.87] select * from `article` where (`survey_name` = 'GGGGGGGGG') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:37:02.159877+08:00] sql.INFO: [3.66] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:14.503366+08:00] sql.INFO: [14.35] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:14.537930+08:00] sql.INFO: [15.89] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:39:15.336388+08:00] sql.INFO: [3.82] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:15.355433+08:00] sql.INFO: [15.88] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:39:22.098502+08:00] sql.INFO: [4.19] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:22.117194+08:00] sql.INFO: [15.69] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:39:23.002818+08:00] sql.INFO: [4.57] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:23.021164+08:00] sql.INFO: [15.48] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:39:36.954487+08:00] sql.INFO: [3.96] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:36.972995+08:00] sql.INFO: [15.87] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:39:38.066365+08:00] sql.INFO: [4.2] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:38.085265+08:00] sql.INFO: [16] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:39:38.640300+08:00] sql.INFO: [3.64] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:38.655581+08:00] sql.INFO: [12.66] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:39:39.688670+08:00] sql.INFO: [3.84] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:39:39.705279+08:00] sql.INFO: [13.95] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:40:05.440553+08:00] sql.INFO: [5.07] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:40:05.460135+08:00] sql.INFO: [15.72] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:47:26.282128+08:00] sql.INFO: [30.95] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:47:26.314702+08:00] sql.INFO: [16.09] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:47:41.401094+08:00] sql.INFO: [4.08] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:47:41.418713+08:00] sql.INFO: [15.41] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:48:25.336689+08:00] sql.INFO: [3.77] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:48:25.352418+08:00] sql.INFO: [13.31] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:48:26.443538+08:00] sql.INFO: [3.71] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:48:26.455382+08:00] sql.INFO: [9.48] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:48:27.176321+08:00] sql.INFO: [3.84] select * from `article` where (`is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:48:27.188825+08:00] sql.INFO: [10.02] select count(*) as aggregate from `article` where (`is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:52:52.509388+08:00] sql.INFO: [14.93] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:52:52.540694+08:00] sql.INFO: [16.23] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:53:04.866158+08:00] sql.INFO: [18.85] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:53:04.881548+08:00] sql.INFO: [14.59] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:53:09.596031+08:00] sql.INFO: [17.59] select * from `article` where (`survey_type` = '0' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:53:09.610727+08:00] sql.INFO: [12.83] select count(*) as aggregate from `article` where (`survey_type` = '0' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:53:35.945781+08:00] sql.INFO: [12.87] select * from `article` where (`survey_type` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:53:35.957851+08:00] sql.INFO: [9.98] select count(*) as aggregate from `article` where (`survey_type` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:53:57.043087+08:00] sql.INFO: [17.85] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:53:57.053932+08:00] sql.INFO: [10.29] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:54:22.585693+08:00] sql.INFO: [15.37] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:22.597659+08:00] sql.INFO: [11.46] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:54:23.452192+08:00] sql.INFO: [16] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:23.464794+08:00] sql.INFO: [12.02] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:54:28.343726+08:00] sql.INFO: [23.73] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:42.259146+08:00] sql.INFO: [26.89] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '1' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:46.269208+08:00] sql.INFO: [18.06] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:46.482986+08:00] sql.INFO: [16.21] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') limit 10 offset 0 [] []
+[2025-02-27T14:54:56.255384+08:00] sql.INFO: [4.21] select * from `article` where (`survey_type` = '0') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:54:56.275013+08:00] sql.INFO: [16.13] select count(*) as aggregate from `article` where (`survey_type` = '0') limit 10 offset 0 [] []
+[2025-02-27T14:55:08.119656+08:00] sql.INFO: [3.55] select * from `article` where (`survey_type` = '0') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:55:08.137311+08:00] sql.INFO: [15.1] select count(*) as aggregate from `article` where (`survey_type` = '0') limit 10 offset 0 [] []
+[2025-02-27T14:55:14.166246+08:00] sql.INFO: [3.61] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:55:14.184394+08:00] sql.INFO: [15.52] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:55:41.509292+08:00] sql.INFO: [4.63] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:55:41.528503+08:00] sql.INFO: [15.94] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:55:42.305346+08:00] sql.INFO: [3.72] select * from `article` where `is_survey` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:55:42.324006+08:00] sql.INFO: [15.7] select count(*) as aggregate from `article` where `is_survey` is not null limit 10 offset 0 [] []
+[2025-02-27T14:56:50.144851+08:00] sql.INFO: [19.96] select * from `article` where (`is_survey` = '0') order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T14:56:50.401413+08:00] sql.INFO: [16.25] select count(*) as aggregate from `article` where (`is_survey` = '0') limit 10 offset 0 [] []
+[2025-02-27T14:57:16.679236+08:00] sql.INFO: [19.15] select * from `article` where (`is_survey` = '0') order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T14:57:16.696512+08:00] sql.INFO: [14.4] select count(*) as aggregate from `article` where (`is_survey` = '0') limit 10 offset 10 [] []
+[2025-02-27T14:59:18.676779+08:00] sql.INFO: [28.55] select * from `article` where (`survey_type` = '0' and `is_survey` = '0') order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T14:59:24.255232+08:00] sql.INFO: [18.11] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T14:59:24.468587+08:00] sql.INFO: [13.96] select count(*) as aggregate from `article` where `survey_name` is not null limit 10 offset 10 [] []
+[2025-02-27T14:59:40.216107+08:00] sql.INFO: [17.18] select * from `article` where (`is_survey` = '0') order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T14:59:40.232298+08:00] sql.INFO: [13.91] select count(*) as aggregate from `article` where (`is_survey` = '0') limit 10 offset 10 [] []
+[2025-02-27T15:01:55.369695+08:00] sql.INFO: [23.58] select * from `article` where (`is_survey` = '0') order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:01:55.386294+08:00] sql.INFO: [14.22] select count(*) as aggregate from `article` where (`is_survey` = '0') limit 10 offset 10 [] []
+[2025-02-27T15:02:03.789116+08:00] sql.INFO: [24.27] select * from `article` where `survey_name` is not null and (`is_survey` = '0') order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:02:08.289031+08:00] sql.INFO: [16.86] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:02:08.472324+08:00] sql.INFO: [12.29] select count(*) as aggregate from `article` where `survey_name` is not null limit 10 offset 10 [] []
+[2025-02-27T15:04:47.749496+08:00] sql.INFO: [21.51] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:04:47.961601+08:00] sql.INFO: [15.87] select count(*) as aggregate from `article` where `survey_name` is not null limit 10 offset 10 [] []
+[2025-02-27T15:06:15.335428+08:00] sql.INFO: [17.72] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:06:15.349648+08:00] sql.INFO: [12.83] select count(*) as aggregate from `article` where `survey_name` is not null limit 10 offset 10 [] []
+[2025-02-27T15:06:24.184954+08:00] sql.INFO: [28.96] select count(*) as aggregate from `article` where `survey_name` is not null [] []
+[2025-02-27T15:06:24.203352+08:00] sql.INFO: [13.53] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:06:24.423747+08:00] sql.INFO: [9.89] select count(*) as aggregate from `article` where `survey_name` is not null limit 10 offset 10 [] []
+[2025-02-27T15:06:28.822945+08:00] sql.INFO: [20.89] select count(*) as aggregate from `article` where `survey_name` is not null [] []
+[2025-02-27T15:06:28.847689+08:00] sql.INFO: [18.83] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:06:30.591938+08:00] sql.INFO: [16.93] select count(*) as aggregate from `article` where `survey_name` is not null [] []
+[2025-02-27T15:06:30.604662+08:00] sql.INFO: [12.2] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 10 [] []
+[2025-02-27T15:06:50.980161+08:00] sql.INFO: [10.48] select count(*) as aggregate from `article` where `survey_name` is not null [] []
+[2025-02-27T15:06:50.985750+08:00] sql.INFO: [4.84] select * from `article` where `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:03.680452+08:00] sql.INFO: [16.84] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '0') and `survey_name` is not null [] []
+[2025-02-27T15:07:03.698432+08:00] sql.INFO: [17.29] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '0') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:07.758830+08:00] sql.INFO: [10.38] select count(*) as aggregate from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null [] []
+[2025-02-27T15:07:07.771547+08:00] sql.INFO: [12.04] select * from `article` where (`survey_name` like '%GGGGGGGGG%' and `survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:14.152155+08:00] sql.INFO: [14.53] select count(*) as aggregate from `article` where (`survey_name` like '%11%' and `survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null [] []
+[2025-02-27T15:07:14.179624+08:00] sql.INFO: [26.86] select * from `article` where (`survey_name` like '%11%' and `survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:26.473825+08:00] sql.INFO: [10.11] select count(*) as aggregate from `article` where (`survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null [] []
+[2025-02-27T15:07:26.491704+08:00] sql.INFO: [17.24] select * from `article` where (`survey_type` = '0' and `is_survey` = '1') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:34.130978+08:00] sql.INFO: [10.2] select count(*) as aggregate from `article` where (`survey_type` = '0') and `survey_name` is not null [] []
+[2025-02-27T15:07:34.149735+08:00] sql.INFO: [18.21] select * from `article` where (`survey_type` = '0') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []
+[2025-02-27T15:07:38.981890+08:00] sql.INFO: [12.04] select count(*) as aggregate from `article` where (`survey_type` = '1') and `survey_name` is not null [] []
+[2025-02-27T15:07:38.998977+08:00] sql.INFO: [16.51] select * from `article` where (`survey_type` = '1') and `survey_name` is not null order by `id` desc limit 10 offset 0 [] []

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác