* adjust for get dingding user.

This commit is contained in:
wangyidong
2020-04-28 16:56:34 +08:00
parent 2372831886
commit 2d8fcc75e5
+2 -1
View File
@@ -57,11 +57,12 @@ class dingapi
$depts = $this->getAllDepts();
if($this->isError()) return array('result' => 'fail', 'message' => $this->errors);
set_time_limit(0);
$users = array();
foreach($depts as $deptID => $deptName)
{
$response = $this->queryAPI($this->apiUrl . "user/simplelist?access_token={$this->token}&department_id={$deptID}");
if($this->isError()) return array('result' => 'fail', 'message' => $this->errors);
if($this->isError()) continue;
foreach($response->userlist as $user) $users[$user->name] = $user->userid;
}