zz 6 years ago
parent
commit
904fdd075c
1 changed files with 5 additions and 2 deletions
  1. 5 2
      app/Http/Controllers/Wap/Book/ChapterController.php

+ 5 - 2
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -557,6 +557,7 @@ class ChapterController extends BaseController
         if ((int)$this->_user_info['balance'] >= $fee) {
             if ($this->bookOrderOrChapterOrder($book_info, $chapter->id, $fee, $chapter->name, $is_remind)) {
                 $this->chapterOrderStats($fee);
+                $this->user->banlace -= $fee;
                 return true;
             }
         }
@@ -1524,10 +1525,12 @@ class ChapterController extends BaseController
         if(!$next_chapter || !$next_chapter->is_vip){
             return ;
         }
-        $last_price = $this->getPrice($this->book_info,$this->chapter);
+
         $price = $this->getPrice($this->book_info,$next_chapter);
 
-        if($price > ($this->user->balance-$last_price)){
+        $flag = $price > $this->user->balance;
+
+        if( $flag ){
             $this->chapter->is_show_ad = 1;
             AdVisitStatService::create($this->uid,$this->book_info->bid,$this->cid,'EXPOSURE');
         }