浏览代码

shelf api

lishiyeaaron 5 年之前
父节点
当前提交
1b4c5b1552
共有 1 个文件被更改,包括 13 次插入14 次删除
  1. 13 14
      app/Http/Controllers/QuickApp/User/UserShelfBooksController.php

+ 13 - 14
app/Http/Controllers/QuickApp/User/UserShelfBooksController.php

@@ -80,28 +80,27 @@ class UserShelfBooksController extends BaseController
         if($res->isEmpty()){
             return response()->success();
         }
-        $record = ReadRecordService::getReadRecord($this->uid);
-//        $record=array([
-//            'bid'=>1,
-//            'time'=>3,
-//            'cid'=>4,
-//        ],[
-//            'bid'=>2,
-//            'time'=>3,
-//            'cid'=>4,
-//        ]);
+//        $record = ReadRecordService::getReadRecord($this->uid);
+        $record=array([
+            'bid'=>1,
+            'time'=>3,
+            'cid'=>1,
+        ],[
+            'bid'=>2,
+            'time'=>3,
+            'cid'=>4,
+        ]);
         foreach ($res as &$v){
             $bid=$v['bid'];
             $last_cid = $v['last_cid'];
-            $last_chapter = ChapterService::getChapterNameById($last_cid,$bid);
-            $v['last_chapter']="最后章节:第{$last_cid}章 {$last_chapter['name']}";
+            $last_chapter = ChapterService::getChapterNameByID($last_cid,$bid);
+            $v['last_chapter']="最后章节:{$last_chapter['name']}";
             foreach ($record as $val){
                 if($v['bid'] == $val['bid']){
                     $v['updated_at'] = $val['time'];
                     $recent_reading_cid = $val['cid'];
-//                    dd($recent_reading_cid);
                     $recent_reading_chapter = ChapterService::getChapterNameById($recent_reading_cid,$bid);
-                    $v['recent_reading_chapter'] = "最近阅读:第{$recent_reading_cid}章 {$recent_reading_chapter['name']}";
+                    $v['recent_reading_chapter'] = "最近阅读:{$recent_reading_chapter['name']}";
                     break;
                 }
             }