fly 5 lat temu
rodzic
commit
21bfac44c4

+ 9 - 9
app/Http/Controllers/QuickApp/Book/ChapterController.php

@@ -46,7 +46,7 @@ class ChapterController extends BaseController
      * @apiSuccess {Int}         data.list.prev_cid   上一章节id
      * @apiSuccess {Int}         data.list.next_cid   下一章节
      * @apiSuccess {String}      data.list.recent_update_at   更新时间
-     * @apiSuccess {Boolean}      data.list.is_need_charge  是否需要充值
+     * @apiSuccess {Int}      data.list.is_need_charge  是否需要充值
      * @apiSuccess {object}      data.meta   分页信息
      * @apiSuccess {Int}         data.meta.total  总条数
      * @apiSuccess {Int}         data.meta.per_page  每页条数
@@ -71,7 +71,7 @@ class ChapterController extends BaseController
      *               prev_cid: 0,
      *               next_cid: 0,
      *               recent_update_at: 2017-11-20 15:01:56,
-     *               is_need_charge: false,
+     *               is_need_charge: 0,
      *            },
      *             {
      *               bid: 5,
@@ -83,7 +83,7 @@ class ChapterController extends BaseController
      *               prev_cid: 0,
      *               next_cid: 0,
      *               recent_update_at: 2017-11-20 15:01:56,
-     *               is_need_charge: false,
+     *               is_need_charge: 0,
      *            },
      *          ]
      *       }
@@ -123,7 +123,7 @@ class ChapterController extends BaseController
      * @apiSuccess {Int}         data.list.prev_cid   上一章节id
      * @apiSuccess {Int}         data.list.next_cid   下一章节
      * @apiSuccess {String}      data.list.recent_update_at   更新时间
-     * @apiSuccess {Boolean}      data.list.is_need_charge  是否需要充值
+     * @apiSuccess {Int}      data.list.is_need_charge  是否需要充值
      * @apiSuccess {object}      data.meta   分页信息
      * @apiSuccess {Int}         data.meta.total  总条数
      * @apiSuccess {Int}         data.meta.per_page  每页条数
@@ -148,7 +148,7 @@ class ChapterController extends BaseController
      *               prev_cid: 0,
      *               next_cid: 0,
      *               recent_update_at: 2017-11-20 15:01:56,
-     *               is_need_charge: false,
+     *               is_need_charge: 0,
      *            },
      *             {
      *               bid: 5,
@@ -160,7 +160,7 @@ class ChapterController extends BaseController
      *               prev_cid: 0,
      *               next_cid: 0,
      *               recent_update_at: 2017-11-20 15:01:56,
-     *               is_need_charge: false,
+     *               is_need_charge: 0,
      *            },
      *          ]
      *          meta:{
@@ -194,14 +194,14 @@ class ChapterController extends BaseController
                 $price = $this->getPrice($book_info);
                 $is_need_charge = $this->isBookNeedCharge($bid, $price);
                 foreach ($chapters as $v) {
-                    $v->is_need_charge = $is_need_charge;
+                    $v->is_need_charge = $is_need_charge && $v->is_vip;
                     $v->price = $price;
                 }
                 break;
             default:
                 foreach ($chapters as $v) {
-                    $v->price = $this->getPrice($book_info, $v->size);
-                    $v->is_need_charge = $this->isChapterNeedCharge($bid, $v->id, $v->price);
+                    $v->price = $v->is_vip ? $this->getPrice($book_info, $v->size) : 0;
+                    $v->is_need_charge = $v->is_vip ? $this->isChapterNeedCharge($bid, $v->id, $v->price) : false;
                 }
                 break;
         }

Plik diff jest za duży
+ 4 - 4
public/kyydoc/api_data.js


Plik diff jest za duży
+ 4 - 4
public/kyydoc/api_data.json


+ 1 - 1
public/kyydoc/api_project.js

@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-11-11T07:00:15.695Z",
+    "time": "2019-11-11T07:13:18.072Z",
     "url": "http://apidocjs.com",
     "version": "0.17.7"
   }

+ 1 - 1
public/kyydoc/api_project.json

@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-11-11T07:00:15.695Z",
+    "time": "2019-11-11T07:13:18.072Z",
     "url": "http://apidocjs.com",
     "version": "0.17.7"
   }