update
This commit is contained in:
@ -48,9 +48,13 @@ class NewsService extends BaseService
|
|||||||
*/
|
*/
|
||||||
public function index(int $id, int $limit = 30, int $page = 1): array
|
public function index(int $id, int $limit = 30, int $page = 1): array
|
||||||
{
|
{
|
||||||
|
$relationId = [
|
||||||
|
'11' => [1, 11],
|
||||||
|
'10' => [9, 10],
|
||||||
|
];
|
||||||
$query = AppNews::formatQuery(['created_at'])
|
$query = AppNews::formatQuery(['created_at'])
|
||||||
->where('is_delete', 0)
|
->where('is_delete', 0)
|
||||||
->where('platform', $id)
|
->where('platform', $relationId[$id] ?? $id)
|
||||||
->select(['id'])
|
->select(['id'])
|
||||||
->orderBy('id', 'desc');;
|
->orderBy('id', 'desc');;
|
||||||
$pagination = $query->paginate($limit, page: $page);
|
$pagination = $query->paginate($limit, page: $page);
|
||||||
|
Reference in New Issue
Block a user