|
@@ -80,28 +80,27 @@ class UserShelfBooksController extends BaseController
|
|
if($res->isEmpty()){
|
|
if($res->isEmpty()){
|
|
return response()->success();
|
|
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){
|
|
foreach ($res as &$v){
|
|
$bid=$v['bid'];
|
|
$bid=$v['bid'];
|
|
$last_cid = $v['last_cid'];
|
|
$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){
|
|
foreach ($record as $val){
|
|
if($v['bid'] == $val['bid']){
|
|
if($v['bid'] == $val['bid']){
|
|
$v['updated_at'] = $val['time'];
|
|
$v['updated_at'] = $val['time'];
|
|
$recent_reading_cid = $val['cid'];
|
|
$recent_reading_cid = $val['cid'];
|
|
-// dd($recent_reading_cid);
|
|
|
|
$recent_reading_chapter = ChapterService::getChapterNameById($recent_reading_cid,$bid);
|
|
$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;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|