zz 6 년 전
부모
커밋
904fdd075c
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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');
         }