15313670163 1 месяц назад
Родитель
Сommit
ad78fb181a
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      app/JsonRpc/NewsService.php

+ 5 - 2
app/JsonRpc/NewsService.php

@@ -767,7 +767,10 @@ class NewsService implements NewsServiceInterface
             // $query = ArticleSurvey::where('art_id',$data['art_id']); 
             
         }else{
-            $survey = Article::where('catid',28)
+            $survey = Article::where(function ($query) {
+                $query->whereRaw("JSON_CONTAINS(cat_arr_id, '28')")
+                      ->orWhereRaw("JSON_CONTAINS(cat_arr_id, '\"28\"')");
+            })
             ->where('status',1)
             ->where('is_survey',1)
             ->select('survey_id')
@@ -779,7 +782,7 @@ class NewsService implements NewsServiceInterface
             $where['sur_id'] = $survey['survey_id'];
             // $query = ArticleSurvey::where('sur_id',$survey['sur_id']);
         }
-        // return Result::success($where);
+        return Result::success($where);
         $result =  ArticleSurvey::where($where)
             ->where(function ($query) {
                 $query->where('is_other', 0)