|
@@ -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("没有信息数据");
|
|
|
}
|