Browse Source

获取新闻列表

15313670163 3 months ago
parent
commit
bd7c676ab1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/JsonRpc/NewsService.php

+ 4 - 0
app/JsonRpc/NewsService.php

@@ -401,6 +401,7 @@ class NewsService implements NewsServiceInterface
             }
         }
         // return Result::success($where);
+
         $rep = Article::where(function ($query) use ($where) {
             foreach ($where as $condition) {
                 if ($condition[1] === 'in') {
@@ -414,6 +415,7 @@ class NewsService implements NewsServiceInterface
         ->limit($data['pageSize'])
         ->offset(($data['page'] - 1) * $data['pageSize'])
         ->get();
+
         $count =  Article::where(function ($query) use ($where) {
             foreach ($where as $condition) {
                 if ($condition[1] === 'in') {
@@ -423,10 +425,12 @@ class NewsService implements NewsServiceInterface
                 }
             }
         })->count();
+
         $data = [
             'rows'=>$rep->toArray(),
             'count'=>$count
         ];
+        
         if(empty($rep)){
             return Result::error("没有信息数据");
         }