Browse Source

new yunqi book

zz 6 năm trước cách đây
mục cha
commit
a7841065f8
1 tập tin đã thay đổi với 16 bổ sung1 xóa
  1. 16 1
      app/Modules/Book/Services/BookService.php

+ 16 - 1
app/Modules/Book/Services/BookService.php

@@ -88,7 +88,16 @@ class BookService
         if($old){
             return -1;
         }
-        $new_yunqi_book = DB::connection('new_yunqi')->table('books')->where('id',$bid)->first();
+        $new_yunqi_book = DB::connection('new_yunqi')
+            ->table('books')
+            ->join('book_configs','books.id','=','book_configs.bid')
+            ->select(
+                'books.id','books.author','books.author','books.intro','books.category_name','books.keyword',
+                'books.status','books.chapter_count','books.size','books.last_chapter','book_configs.book_name as name',
+                'book_configs.cover','book_configs.force_subscribe_chapter_seq','book_configs.charge_type','book_configs.roles'
+            )
+            ->where('id',$bid)
+            ->first();
         if(!$new_yunqi_book){
             return -2;
         }
@@ -126,6 +135,12 @@ class BookService
             }
         }
         \Artisan::call('book:afs',['bid'=>[$book->id]]);
+        DB::table('book_configs')->where('bid',$book->id)->update([
+            'force_subscribe_chapter_seq'=>$new_yunqi_book->force_subscribe_chapter_seq,
+            'roles'=>$new_yunqi_book->roles,
+            'charge_type'=>$new_yunqi_book->charge_type,
+            'cp_source'=>'new_yunqi'
+        ]);
         return 0;
     }
 }