diff --git a/module/Admin/src/Admin/Controller/UsersController.php b/module/Admin/src/Admin/Controller/UsersController.php index a835e96c..b7443d0d 100644 --- a/module/Admin/src/Admin/Controller/UsersController.php +++ b/module/Admin/src/Admin/Controller/UsersController.php @@ -11,6 +11,7 @@ namespace Admin\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; +use Zend\View\Model\JsonModel; use Sookon\Helpers\View as view; use Sookon\Helpers\Db; @@ -100,6 +101,45 @@ class UsersController extends AbstractActionController return view::Post($this,"用户密码重置失败!",-1); } } + + if($ac == "auth") + { + if($this->getRequest()->isXmlHttpRequest()) + { + $userid = $this->params()->fromPost('userid'); + $usertype = $this->params()->fromPost('usertype'); + + if(empty($userid) || empty($usertype)) + { + return new JsonModel(array('error'=>"参数错误")); + } + + $users = new \Westdc\Member\Member; + if($users->changeUsertype($userid,$usertype) > 0) + { + return new JsonModel(array('success'=>1)); + }else{ + return new JsonModel(array('error'=>"未发生任何变更")); + } + } + }//修改usetype + + if($ac == 'del') + { + if(!is_numeric($id) || $id < 1) + { + return view::Post($this,"参数错误",-1); + } + + $users = new \Westdc\Member\Member; + + if($users->deleteUser($id) > 0) + { + return view::Post($this,"删除成功",-1); + }else{ + return view::Post($this,"删除失败",-1); + } + }//删除 } # 邮件模板模块 diff --git a/module/Admin/view/admin/users/index.phtml b/module/Admin/view/admin/users/index.phtml index cd1ae99a..27b1c0b1 100644 --- a/module/Admin/view/admin/users/index.phtml +++ b/module/Admin/view/admin/users/index.phtml @@ -37,6 +37,7 @@