fly 5 rokov pred
rodič
commit
ecf086da4c

+ 3 - 2
app/Http/Controllers/QuickApp/Book/ChapterController.php

@@ -260,15 +260,16 @@ class ChapterController extends BaseController
     public function index(Request $request, $bid, $cid)
     {
         $oldbid = $bid;
+        $bid = BookService::decodeBidStatic($bid);
         //获取图书信息
         $book_info  = BookConfigService::getBookById($bid);
-        if (empty($book_info)) return response()->error('QAPP_SYS_ERROR');
+        if (empty($book_info))
+            return response()->error('QAPP_SYS_ERROR');
         //获取章节信息
         $chapter = ChapterService::getChapterNameById($cid, $bid);
         if (!$chapter) {
             return response()->error('QAPP_SYS_ERROR');
         }
-
         if ($chapter->is_vip == 0) {
             ReadRecordService::addReadRecord([
                 'uid' => $this->uid, 'bid' => $bid, 'book_name' => $book_info->book_name,

+ 6 - 4
app/Http/Controllers/QuickApp/Book/Transformers/ChapterListTransformer.php

@@ -1,14 +1,16 @@
 <?php
 
 namespace App\Http\Controllers\QuickApp\Book\Transformers;
+
 use Hashids;
+
 class ChapterListTransformer
 {
 
-    public function transform($chapter){
+    public function transform($chapter)
+    {
         return [
             'bid'       =>  Hashids::encode($chapter->bid),
-            //'bid_no_hash'       =>  ($chapter->bid),
             'chapter_id'       =>  $chapter->id,
             'chapter_name'   =>  $chapter->name,
             'chapter_sequence'   =>  $chapter->sequence,
@@ -17,7 +19,7 @@ class ChapterListTransformer
             'prev_cid'   =>  $chapter->prev_cid,
             'next_cid'   =>  $chapter->next_cid,
             'recent_update_at'   =>  $chapter->recent_update_at,
-            'is_need_subscirbe' =>isset($chapter->is_need_subscirb)?$chapter->is_need_subscirb:'',
+            'is_need_subscirbe' => isset($chapter->is_need_subscirb) ? $chapter->is_need_subscirb : '',
         ];
     }
-}
+}