/** * 增加用户 */ public function addAction() { if ($this->_request->isPost()) { $aUser = $this->_checkData('add'); if (empty($aUser)) { return null; } if (Model_Admin::getAdminByName($aUser['sAdminName'])) { return $this->showMsg('用户已经存在!', false); } if (Model_Admin::addData($aUser) > 0) { return $this->showMsg('用户增加成功!', true); } else { return $this->showMsg('用户增加失败!', false); } } else { $this->assign('aCity', Model_City::getPairCitys()); $this->assign('aRole', Model_Role::getPairRoles()); } }