where('topic_id', $topicId); $count = $goodsModel->count(); $itemIds = $goodsModel->select('item_id') ->orderBy('sort_num', 'desc') ->offset(($page-1) * $pageSize) ->limit($pageSize) ->pluck('item_id') ->toArray(); return [$itemIds, $count]; } }