public function addappAction() { //添加新应用 if ($this->request->isPost()) { $this->view->disable(); $post = json_decode(file_get_contents("php://input"), true); $app = new App(); $app->setName(htmlspecialchars(trim($post['name']))); $app->setRemark(htmlspecialchars(trim($post['remark']))); $app->setPid(intval($post['pid'])); $app->setShow(intval($post['show'])); $app->setLevel(intval($post['pid']) > 0 ? 2 : 1); $app->setAddTime(); $app->setAddIp(); $app->save(); } }