public function actionRemoveAdmin() { // 检查参数 if (!isset($_REQUEST['memberId']) || !isset($_REQUEST['type']) || !isset($_REQUEST['sendTime'])) { $this->_return('MSG_ERR_LESS_PARAM'); } $memberId = Yii::app()->request->getParam('memberId', NULL); $type = Yii::app()->request->getParam('type', NULL); $sendTime = Yii::app()->request->getParam('sendTime', NULL); $departmentId = Yii::app()->request->getParam('department', NULL); $mac = Yii::app()->request->getParam('mac', NULL); // 检查综合行政是否存在 $name = HT_Member::model()->getNameByMemberId($memberId); if (!$name) { $this->_return('MSG_NO_MEMBER'); } // 删除综合行政(管理员) $retCode = HT_Member::model()->removeAdmin($memberId, $departmentId); echo $retCode; switch ($retCode) { case 0: break; case 1: $this->_return('MSG_NO_MEMBER'); break; case 2: $this->_return('MSG_ERR_UNKOWN'); break; default: $this->_return('MSG_ERR_UNKOWN'); break; } // 记录LOG $memo = sprintf('type:%d', $type); HT_Log::model()->_admin_log($memberId, $departmentId, 0, 'REMOVE_ADMIN', $sendTime, $mac, $memo); // 发送返回值 $this->_return('MSG_SUCCESS'); }
public function actionGetTeachers() { // 检查参数 : no param $departmentId = Yii::app()->request->getParam('department', NULL); $mac = Yii::app()->request->getParam('mac', NULL); // 获取老师列表 $data = HT_Data::model()->getTeachers($departmentId); // 记录LOG HT_Log::model()->_admin_log(0, $departmentId, 0, 'GET_TEACHER_INFO', NULL, $mac); // 发送返回值 $this->_return('MSG_SUCCESS', $data); }