getMeta($data), 'list' => $this->newEachBookList($data), ]; } private function newEachBookList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'bid' => getProp($item, 'bid'), 'book_name' => getProp($item, 'book_name'), 'origin_book_name' => getProp($item, 'origin_book_name') ? getProp($item, 'origin_book_name') : getProp($item, 'book_name'), 'status' => getProp($item, 'status'), 'status_info' => getProp($item, 'status') == 1 ? '已完结' : '连载中', 'version_count' => getProp($item, 'version_count'), ]; } return $result; } // 章节列表 public function newBuildChapterList($data): array { return [ 'meta' => getMeta($data['list']), 'header' => $data['header'], 'list' => $this->newEachChapterList($data['list']), ]; } private function newEachChapterList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'cid' => getProp($item, 'cid'), 'chapter_name' => getProp($item, 'chapter_name'), 'sequence' => getProp($item, 'sequence'), 'size' => getProp($item, 'size'), 'generate_status' => getProp($item, 'generate_status'), 'audio_url' => getProp($item, 'audio_url'), 'remark' => getProp($item, 'remark'), ]; } return $result; } // 版本列表 public function newBuildVersionList($data): array { return [ 'meta' => getMeta($data), 'list' => $this->newEachVersionList($data), ]; } private function newEachVersionList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'version_id' => getProp($item, 'id'), 'version_name' => getProp($item, 'version_name'), 'bid' => getProp($item, 'bid'), 'book_name' => getProp($item, 'book_name'), 'created_at' => getProp($item, 'created_at'), ]; } return $result; } // 合成任务列表 public function newBuildTaskList($data): array { return [ 'meta' => getMeta($data), 'list' => $this->newEachTaskList($data), ]; } private function newEachTaskList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'task_id' => getProp($item, 'id'), 'task_name' => getProp($item, 'task_name'), 'generate_status' => getProp($item, 'generate_status'), 'bid' => getProp($item, 'bid'), 'version_id' => getProp($item, 'version_id'), 'cid' => getProp($item, 'cid'), 'created_at' => getProp($item, 'created_at'), ]; } return $result; } // 音效列表 public function newBuildAudioEffectList($data): array { return [ 'meta' => getMeta($data), 'list' => $this->newEachAudioEffectList($data), ]; } private function newEachAudioEffectList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'audio_effect_id' => getProp($item, 'id'), 'audio_effect_name' => getProp($item, 'audio_effect_name'), 'audio_effect_url' => getProp($item, 'audio_effect_url'), 'playtime_seconds' => getProp($item, 'playtime_seconds'), 'created_at' => transDate(getProp($item, 'created_at')), ]; } return $result; } // bgm列表 public function newBuildBgmList($data): array { return [ 'meta' => getMeta($data), 'list' => $this->newEachBgmList($data), ]; } private function newEachBgmList($list): array { $result = []; if (empty($list)) return $result; foreach ($list as $item) { $result[] = [ 'bgm_id' => getProp($item, 'id'), 'bgm_name' => getProp($item, 'bgm_name'), 'bgm_url' => getProp($item, 'bgm_url'), 'playtime_seconds' => getProp($item, 'playtime_seconds'), 'created_at' => transDate(getProp($item, 'created_at')), ]; } return $result; } }