Browse Source

章节格式

zhoulj 3 years ago
parent
commit
b248285ae3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/Http/Controllers/QuickApp/Book/ChapterController.php

+ 4 - 0
app/Http/Controllers/QuickApp/Book/ChapterController.php

@@ -487,6 +487,10 @@ class ChapterController extends BaseController
         $chapter_content = ChapterService::getChapter($bid, $cid);
         $chapter_content = ChapterService::getChapter($bid, $cid);
         if (!$chapter_content) return false;
         if (!$chapter_content) return false;
         $chapter->content = trim(str_replace($chapter_content->name, '', $chapter_content->content));
         $chapter->content = trim(str_replace($chapter_content->name, '', $chapter_content->content));
+        // 格式特殊处理
+        $chapter->content = trim(str_replace('    ', '  ', $chapter_content->content));
+//         $chapter->content = trim(str_replace('\n\n', '\n', $chapter_content->content));
+        
         //统计点击率
         //统计点击率
         $key   = 'book_click_num_bid_' . $bid;
         $key   = 'book_click_num_bid_' . $bid;
         $field = date('Y-m-d');
         $field = date('Y-m-d');