diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index 04d2de620b..34238f806b 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -65,4 +65,37 @@ class xuanxuanChat extends chatModel unset($_SESSION['user']); return $entries; } + + public function getUserListOutput($idList = array(), $userID) + { + $output = new stdclass(); + $output->module = 'chat'; + $output->method = 'userGetList'; + + $users = $this->getUserList($status = '', $idList, $idAsKey = false); + if(dao::isError()) + { + $output->result = 'fail'; + $output->message = 'Get userlist failed.'; + } + else + { + $output->result = 'success'; + $output->users = !empty($userID) ? array($userID) : array(); + $output->data = $users; + + $this->app->loadLang('user', 'sys'); + $roles = $this->lang->user->roleList; + + $allDepts = $this->loadModel('dept')->getListByType('dept'); + $depts = array(); + foreach($allDepts as $id => $dept) + { + $depts[$id] = array('name' => $dept->name, 'order' => (int)$dept->order, 'parent' => (int)$dept->parent); + } + $output->roles = $roles; + $output->depts = $depts; + } + return $output; + } } diff --git a/xuanxuan/module/chat/ext/model/xuanxuan.php b/xuanxuan/module/chat/ext/model/xuanxuan.php index e99cb1744f..72adc1b3bd 100644 --- a/xuanxuan/module/chat/ext/model/xuanxuan.php +++ b/xuanxuan/module/chat/ext/model/xuanxuan.php @@ -6,33 +6,6 @@ public function getExtensionList($userID) public function getUserListOutput($idList = array(), $userID) { - $output = new stdclass(); - $output->module = 'chat'; - $output->method = 'userGetList'; - - $users = $this->getUserList($status = '', $idList, $idAsKey = false); - if(dao::isError()) - { - $output->result = 'fail'; - $output->message = 'Get userlist failed.'; - } - else - { - $output->result = 'success'; - $output->users = !empty($userID) ? array($userID) : array(); - $output->data = $users; - - $this->app->loadLang('user', 'sys'); - $roles = $this->lang->user->roleList; - - $allDepts = $this->loadModel('dept')->getListByType('dept'); - $depts = array(); - foreach($allDepts as $id => $dept) - { - $depts[$id] = array('name' => $dept->name, 'order' => (int)$dept->order, 'parent' => (int)$dept->parent); - } - $output->roles = $roles; - $output->depts = $depts; - } - return $output; + return $this->loadExtension('xuanxuan')->getUserListOutput($idList, $userID); } +