|
@@ -22,16 +22,16 @@ class UserShelfBooksController extends BaseController
|
|
|
}
|
|
|
$record = ReadRecordService::getReadRecord($this->uid);
|
|
|
foreach ($res as &$v) {
|
|
|
- $bid = $v['bid'];
|
|
|
- $last_cid = $v['last_cid'];
|
|
|
- $last_chapter = ChapterService::getChapterNameByID($last_cid, $bid);
|
|
|
+ $bid = $v['bid'];
|
|
|
+ $last_cid = $v['last_cid'];
|
|
|
+ $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'];
|
|
|
- $v['recent_cid'] = $recent_reading_cid;
|
|
|
- $recent_reading_chapter = ChapterService::getChapterNameById($recent_reading_cid, $bid);
|
|
|
+ $v['updated_at'] = $val['time'];
|
|
|
+ $recent_reading_cid = $val['cid'];
|
|
|
+ $v['recent_cid'] = $recent_reading_cid;
|
|
|
+ $recent_reading_chapter = ChapterService::getChapterNameById($recent_reading_cid, $bid);
|
|
|
$v['recent_reading_chapter'] = "最近阅读:{$recent_reading_chapter['name']}";
|
|
|
break;
|
|
|
}
|
|
@@ -61,17 +61,15 @@ class UserShelfBooksController extends BaseController
|
|
|
*/
|
|
|
public function addShelf(Request $request)
|
|
|
{
|
|
|
- return response()->success();
|
|
|
$param = $request->except('_url');
|
|
|
if (checkParam($param, ['bid'])) {
|
|
|
return response()->error('LACK_PARAM');
|
|
|
}
|
|
|
|
|
|
- $param['uid'] = $this->uid;
|
|
|
- $param['bid'] = Hashids::decode($param['bid'])[0];
|
|
|
+ $param['uid'] = $this->uid;
|
|
|
+ $param['bid'] = Hashids::decode($param['bid'])[0];
|
|
|
$param['distribution_channel_id'] = $this->distribution_channel_id;
|
|
|
- $res = null;
|
|
|
- $res = UserShelfBooksService::create($param);
|
|
|
+ $res = UserShelfBooksService::create($param);
|
|
|
try {
|
|
|
} catch (\Exception $e) {
|
|
|
return response()->error('QAPP_PARAM_ERROR');
|
|
@@ -109,7 +107,7 @@ class UserShelfBooksController extends BaseController
|
|
|
if (empty($bid)) return response()->error('LACK_PARAM');
|
|
|
$param['uid'] = $this->uid;
|
|
|
$param['bid'] = Hashids::decode($bid)[0];
|
|
|
- $res = UserShelfBooksService::del($this->uid, $param['bid']);
|
|
|
+ $res = UserShelfBooksService::del($this->uid, $param['bid']);
|
|
|
if ($res) {
|
|
|
return response()->success();
|
|
|
}
|
|
@@ -139,7 +137,7 @@ class UserShelfBooksController extends BaseController
|
|
|
* is_on:0
|
|
|
* }
|
|
|
*/
|
|
|
- public function isOnshelf(Request $request)
|
|
|
+ public function isOnshelf(Request $request)
|
|
|
{
|
|
|
$bid = $request->input('bid');
|
|
|
if (!$bid) return response()->error('LACK_PARAM');
|