limitOffset, $this->limitLength); if (!is_array($result)) { return []; } $data = []; foreach ($result['room_info'] as $item) { $data[] = [ 'name' => $item['name'], 'room_id' => $item['roomid'], 'cover_img' => $item['cover_img'], 'anchor_name' => $item['anchor_name'], 'status' => $item['live_status'], 'live_status' => LiveEnum::getLiveStatus($item['live_status']), 'goods' => count($item['goods']), 'start_time' => date('Y-m-d H:i:s', $item['start_time']), 'end_time' => date('Y-m-d H:i:s', $item['end_time']) ]; } $this->total = $result['total']; return $data; } public function count(): int { return $this->total; } }