request->post('book_id'); $chapterId = $this->request->post('chapter_id', 0); $idx = $this->request->post('idx', 0); if (!Cookie::has('user_id')) { $this->error('用户没有登录'); } $result = BookService::instance()->setBookShelf($bookId); if ($result->code == ErrorCodeConstants::SUCCESS) { $this->success(); } else { $this->error($result->msg); } } public function delbooks(){ if ($this->request->isAjax()) { $bookIds = $this->request->post('bookIds'); $bookArr = \GuzzleHttp\json_decode($bookIds, true); $data = BookService::instance()->delBookShelf($bookArr); return json(['err' => 0]); } } }