This commit is contained in:
toom1996
2025-08-04 17:00:06 +08:00
parent 66b7df8cb3
commit 83ac168a8c

View File

@ -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();
}
}