陈德本 %!s(int64=5) %!d(string=hai) anos
pai
achega
52775725b7
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      App/Api/Controller/Novel/Api.php

+ 15 - 0
App/Api/Controller/Novel/Api.php

@@ -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);