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