diff --git a/app/Rpc/baoxian/NewsService.php b/app/Rpc/baoxian/NewsService.php index fd26c91..c9887cc 100644 --- a/app/Rpc/baoxian/NewsService.php +++ b/app/Rpc/baoxian/NewsService.php @@ -136,8 +136,17 @@ class NewsService extends BaseService } } - $articles['articles'] = $res; + $articles['articles'] = $res;// 随机推荐 + $articles['about'] = AppNews::formatQuery(['created_at']) + ->where('platform', $id) + ->where('is_delete', 0) + ->select(['title', 'id']) + ->limit(10) + ->orderBy(Db::raw('RAND()')) + ->get() + ->toArray(); $total = current($total)?->total ?? 0; + var_dump('pageCOunt',$total / $limit); return $this->getResponse()->setExtra('total', ceil($total / $limit))->setData($articles)->setCode(0)->send(); } } \ No newline at end of file