Browse Source

content split

zz 6 years ago
parent
commit
bf277c8cc5
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/Modules/Book/Services/ChapterService.php

+ 3 - 3
app/Modules/Book/Services/ChapterService.php

@@ -290,7 +290,7 @@ class ChapterService
     }
 
     public static function splitContentAll($bid){
-        $chapters = Chapter::where('bid',$bid)->where('size','>=',4000)->select('id','sequence')->orderBy('sequence')->get();
+        $chapters = Chapter::where('bid',$bid)->where('size','>=',3300)->select('id','sequence')->orderBy('sequence')->get();
         $i = 0;
         $count = 0;
         $end_sequence = 0;
@@ -317,7 +317,7 @@ class ChapterService
     public static function splitContent($chapter_id)
     {
         $chapter = self::getChapterById($chapter_id);
-        if(!$chapter || $chapter->bid <0 || $chapter->size < 4500) return [];
+        if(!$chapter || $chapter->bid <0 || $chapter->size < 3300) return [];
         $content_list = explode("\r\n",$chapter->content);
         //print_r($content_list);
         $count = 1;
@@ -345,7 +345,7 @@ class ChapterService
             ];
         }
 
-        if($data && $data[$count-1]['size'] <1500){
+        if($data && $data[$count-1]['size'] <800){
             $data[$count-2]['content'] = $data[$count-2]['content'].$data[$count-1]['content'];
             $data[$count-2]['size'] = $data[$count-2]['size']+$data[$count-1]['size'];
             unset($data[$count-1]);