zhanglinxin 1 年之前
父節點
當前提交
f4043099cf
共有 2 個文件被更改,包括 18 次插入18 次删除
  1. 17 17
      application/api/controller/Dingtalk.php
  2. 1 1
      application/common/service/DingtalkService.php

+ 17 - 17
application/api/controller/Dingtalk.php

@@ -57,23 +57,23 @@ class Dingtalk extends Base
     {
         $dept_id = input('dept_id');
         $resp = DingtalkService::user_list($dept_id);
-        $data = [];
-        foreach ($resp->list as $value) {
-            $data[] = [
-                'userid' => $value->userid,
-                'unionid' => $value->unionid,
-                'name' => $value->name,
-                'avatar' => $value->avatar,
-                'mobile' => isset($value->mobile) ? $value->mobile : '',
-                'email' => isset($value->email) ? $value->email : '',
-                'title' => $value->title,
-                'manager_userid' => isset($value->manager_userid) ? $value->manager_userid : '',
-                'department' => implode(',', $value->dept_id_list),
-            ];
-        }
-        if ($data) {
-            User::insertAll($data);
-        }
+//        $data = [];
+//        foreach ($resp->list as $value) {
+//            $data[] = [
+//                'userid' => $value->userid,
+//                'unionid' => $value->unionid,
+//                'name' => $value->name,
+//                'avatar' => $value->avatar,
+//                'mobile' => isset($value->mobile) ? $value->mobile : '',
+//                'email' => isset($value->email) ? $value->email : '',
+//                'title' => $value->title,
+//                'manager_userid' => isset($value->manager_userid) ? $value->manager_userid : '',
+//                'department' => implode(',', $value->dept_id_list),
+//            ];
+//        }
+//        if ($data) {
+//            User::insertAll($data);
+//        }
         $this->success('获取部门用户详情', $resp);
     }
 

+ 1 - 1
application/common/service/DingtalkService.php

@@ -75,7 +75,7 @@ class DingtalkService
         $resp = $c->execute($req, $accessToken, "https://oapi.dingtalk.com/topapi/v2/user/list");
         if($resp->errcode == 0 && $resp->errmsg == 'ok'){
             $result = $resp->result;
-            return $result;
+            return $resp;
         }
         except($resp->errcode.' '.$resp->errmsg);
     }