zz 6 年之前
父节点
当前提交
ef2e007296
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      app/Http/Controllers/Wap/Book/ChapterController.php

+ 4 - 3
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -392,16 +392,17 @@ class ChapterController extends BaseController
             $this->getChapter();
             $this->getChapter();
             return response()->item(new ChapterTransformer, $this->chapter);
             return response()->item(new ChapterTransformer, $this->chapter);
         }
         }
+        //获取价格
+        $fee = $this->getPrice($book_info, $chapter);
         //广告
         //广告
-        if($this->isUserInAdSample() && $ad_status && $ad_status == 1){
+        if($this->isUserInAdSample() && $ad_status && $ad_status == 1 && $user_info->balance < $fee){
             $this->getChapter();
             $this->getChapter();
             $this->bookOrderOrChapterOrder($book_info, $cid, 0, $chapter->name, 1);
             $this->bookOrderOrChapterOrder($book_info, $cid, 0, $chapter->name, 1);
             return response()->item(new ChapterTransformer, $this->chapter);
             return response()->item(new ChapterTransformer, $this->chapter);
         }
         }
         //以上都是不用付费的情况******************************************************
         //以上都是不用付费的情况******************************************************
         //未付费
         //未付费
-        //获取价格
-        $fee = $this->getPrice($book_info, $chapter);
+
         //返回的价格信息
         //返回的价格信息
         $data = [
         $data = [
             'book_id' => $this->en_bid,
             'book_id' => $this->en_bid,