From 8ba462ff46fcfb6e36bbc8cfe47fb64a004a375c Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 24 Feb 2020 14:11:33 +0800 Subject: [PATCH] Adjust enterprise wechat work message notice --- lib/wechatapi/wechatapi.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/wechatapi/wechatapi.class.php b/lib/wechatapi/wechatapi.class.php index 82115f576d..80b4f1bb93 100644 --- a/lib/wechatapi/wechatapi.class.php +++ b/lib/wechatapi/wechatapi.class.php @@ -53,7 +53,7 @@ class wechatapi */ public function getAllUsers() { - $depts = $this->getAllDepts(); + $depts = $this->getAgent(); if($this->isError()) return array('result' => 'fail', 'message' => $this->errors); $users = array(); @@ -70,12 +70,12 @@ class wechatapi } /** - * Get all depts. + * Get agent details. * * @access public * @return stdClass */ - public function getAllDepts() + public function getAgent() { $response = $this->queryAPI($this->apiUrl . "agent/get?access_token={$this->token}&agentid={$this->agentId}"); @@ -83,7 +83,8 @@ class wechatapi $deptInfo->userList = array(); if(isset($response->allow_userinfos)) { - foreach ($response->allow_userinfos->user as $user) { + foreach ($response->allow_userinfos->user as $user) + { $userInfo = $this->queryAPI($this->apiUrl . "user/get?access_token={$this->token}&userid={$user->userid}"); $deptInfo->userList[$userInfo->name] = $userInfo->userid; }