|
@@ -65,6 +65,21 @@ class Api extends Controller
|
|
|
];
|
|
];
|
|
|
$result = $response;
|
|
$result = $response;
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($do == "list") {
|
|
|
|
|
+ $chapter=Book::getInstance()->getChapter($book_id);
|
|
|
|
|
+ $chapter=\GuzzleHttp\json_decode($chapter,true);
|
|
|
|
|
+ $_chapter=[];
|
|
|
|
|
+ foreach ($chapter['data']['list'] as $item) {
|
|
|
|
|
+ foreach ($item['list'] as $key=>$val) {
|
|
|
|
|
+ $_chapter[]=[
|
|
|
|
|
+ 'index'=>$key,
|
|
|
|
|
+ 'id'=>$val['id'],
|
|
|
|
|
+ 'name'=>$val['name']
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $result = $_chapter;
|
|
|
|
|
+ }
|
|
|
if ($do == "content") {
|
|
if ($do == "content") {
|
|
|
$result = Book::getInstance()->getContent($book_id, $chapter_id);
|
|
$result = Book::getInstance()->getContent($book_id, $chapter_id);
|
|
|
$result = json_decode($result, true);
|
|
$result = json_decode($result, true);
|