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

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

@@ -1506,7 +1506,6 @@ class ChapterController extends BaseController
         if($this->book_info->charge_type != 'CHAPTER'){
             return ;
         }
-        Log::info('11111111111111111111111111');
         //用户是否在广告样本中
         if(!$this->isUserInAdSample()) return ;
         $cid = 0;
@@ -1516,23 +1515,20 @@ class ChapterController extends BaseController
         if(!$cid){
             return ;
         }
-        Log::info('2222222222222222222222222');
         //如果下一张已经付费,广告不显示
         if($this->getOrderRecord($this->book_info->bid, $cid)){
             return ;
         }
-        Log::info('3333333333333333333333333333');
         $next_chapter  = ChapterService::getChapterNameById($cid, $this->book_info->bid);
         //下一章事vip的话 才显示广告
         if(!$next_chapter || !$next_chapter->is_vip){
             return ;
         }
-        Log::info('444444444444444444444444');
+        $last_price = $this->getPrice($this->book_info,$this->chapter);
         $price = $this->getPrice($this->book_info,$next_chapter);
 
-        if($price > $this->user->balance){
+        if($price > ($this->user->balance-$last_price)){
             $this->chapter->is_show_ad = 1;
-            Log::info('55555555555555555555555555555555');
             AdVisitStatService::create($this->uid,$this->book_info->bid,$this->cid,'EXPOSURE');
         }
     }