/** * 打印书籍 * @method POST_printAction * @todo 计价 * @param integer $id [description] * @author NewFuture */ public function POST_printAction($id = 0) { $uid = $this->auth(); $response['status'] = 0; if (!($Book = BookModel::find($id))) { $response['info'] = '无效书籍'; } else { $task = ['use_id' => $uid, 'url' => 'book/' . $id]; $task['pri_id'] = $Book['pri_id']; $task['name'] = $Book['name']; if ($tid = TaskModel::insert($task)) { $Book->inc('count'); $response['info'] = ['id' => $tid, 'msg' => '保存成功']; } else { $response['info'] = '保存出错'; } } $this->response = $response; }