/** * 删除 * POST /share/123/print * @method 添加打印任务 * @author NewFuture */ public function POST_printAction($id = 0) { $userid = $this->auth(); $response['status'] = 0; if (!($share = ShareModel::where('status', '>', 0)->field('name,url')->find())) { $response['info'] = '此分享已经删除!'; } elseif (!Input::post('pid', $pid, 'int')) { $response['info'] = '请选择打印店!'; } else { $task = TaskModel::create('post'); $task['use_id'] = $userid; $task['pid'] = $pid; $task['url'] = File::addTask($share['url']); $task['name'] = $share['name']; if (!($tid = TaskModel::insert($task))) { $response['info'] = '任务添加失败'; } else { $response['status'] = 1; $response['info'] = ['msg' => '任务添加成功', 'id' => $tid]; } } $this->response = $response; }