update
This commit is contained in:
@ -64,8 +64,8 @@ class NewsService extends BaseService
|
||||
$query->where('platform', $id);
|
||||
}
|
||||
|
||||
$query->select(['id'])
|
||||
->orderBy('id', 'desc');;
|
||||
$query->select(['id'])->orderBy('id', 'desc');
|
||||
$total = $query->count();
|
||||
$pagination = $query->paginate($limit, page: $page);
|
||||
$ids = [];
|
||||
foreach ($pagination->items() as $item) {
|
||||
@ -74,6 +74,14 @@ class NewsService extends BaseService
|
||||
|
||||
$value = AppNews::query()->whereIn('id', $ids)->orderBy('id', 'desc')->get()->toArray();
|
||||
|
||||
return $this->getResponse()->setData($value)->setCode(0)->send();
|
||||
$about = AppNews::formatQuery(['created_at'])
|
||||
->where('platform', $id)
|
||||
->where('is_delete', 0)
|
||||
->select(['title', 'id', 'cover'])
|
||||
->limit(10)
|
||||
->orderBy('id', 'desc')
|
||||
->get()
|
||||
->toArray();
|
||||
return $this->getResponse()->setExtra('about', $about)->setExtra('total', round($total / $limit))->setData($value)->setCode(0)->send();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user