This commit is contained in:
toom1996
2025-07-11 15:04:14 +08:00
parent 0a83e2dfc6
commit cae6609d71

View File

@ -48,9 +48,13 @@ class NewsService extends BaseService
*/
public function index(int $id, int $limit = 30, int $page = 1): array
{
$relationId = [
'11' => [1, 11],
'10' => [9, 10],
];
$query = AppNews::formatQuery(['created_at'])
->where('is_delete', 0)
->where('platform', $id)
->where('platform', $relationId[$id] ?? $id)
->select(['id'])
->orderBy('id', 'desc');;
$pagination = $query->paginate($limit, page: $page);