* Move xuanxuan method.

This commit is contained in:
Yagami
2019-01-23 15:37:22 +08:00
parent 9d464ca6d5
commit 2ced50d58a
2 changed files with 35 additions and 29 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}