Ver código fonte

qapp chapter order remind

zz 3 anos atrás
pai
commit
217057ea65

+ 10 - 15
app/Http/Controllers/QuickApp/Book/ChapterController.php

@@ -476,7 +476,7 @@ class ChapterController extends BaseController
         //统计
         $this->stats();
         $next_chapter_order_status = $this->nextChapterOrderStatus($bid,$chapter->next_cid);
-        $chapter->next_is_paid = $next_chapter_order_status['next_is_paid'];
+        $chapter->next_chapter_status = $next_chapter_order_status['next_chapter_status'];
         $chapter->next_price = $next_chapter_order_status['next_price'];
         $chapter->charge_type = $this->book_info->charge_type;
         $this->userBookCombination($chapter);
@@ -485,22 +485,17 @@ class ChapterController extends BaseController
 
 
     private function nextChapterOrderStatus($bid,$cid){
+        $chapter = ChapterService::getChapterNameById($cid, $bid);
+        if(!$chapter || $chapter->is_vip == 0 || $this->book_info->charge_type == 'BOOK'){
+            return  ['next_chapter_status'=>0,'next_price'=>0];
+        }
+
         $is_paid = $this->getOrderRecord($bid,$cid);
-        $result = ['next_is_paid'=>0,'next_price'=>0];
-        if(!$is_paid){
-            $chapter = ChapterService::getChapterNameById($cid, $bid);
-            if($chapter->is_vip == 0){
-                $result['next_is_paid'] = 1;
-                return $result;
-            }
-            if($chapter){
-                $fee  = $this->getPrice($this->book_info, $chapter->size);
-                $result['next_price'] = $fee;
-            }
-        }else{
-            $result['next_is_paid'] = 1;
+        if($is_paid){
+            return  ['next_chapter_status'=>1,'next_price'=>0];
         }
-        return $result;
+        $fee  = $this->getPrice($this->book_info, $chapter->size);
+        return  ['next_chapter_status'=>2,'next_price'=>$fee];
     }
 
     //短续长

+ 1 - 1
app/Http/Controllers/QuickApp/Book/Transformers/ChapterTransformer.php

@@ -19,7 +19,7 @@ class ChapterTransformer
             'chapter_content'   =>  $chapter->content,
             'sign_status'   =>  $chapter->sign_status,
             'force_add_desk_type'   =>  $chapter->force_add_desk_type,
-            'next_is_paid'   =>  $chapter->next_is_paid,
+            'next_chapter_status'   =>  $chapter->next_chapter_status,
             'next_price'   =>  $chapter->next_price,
             'charge_type'   =>  $chapter->charge_type
         ];