cqpCow 10 月之前
父節點
當前提交
57ca6bf0ea
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Service/ImportService.php

+ 3 - 2
app/Service/ImportService.php

@@ -164,8 +164,9 @@ class ImportService extends Service
         $config_array = config($config) ?? [];
         if(empty($config_array)) return [false, '配置文件不存在', ''];
 
-        $model = BasicType::TopClear($user,$data);
-        $result = $model->whereRaw('type = 22 And del_time = 0')->get()->toArray();
+        $depart_id = $this->getDepart($user);
+        $top_depart_id = $user['depart_map'][$depart_id] ?? 0;
+        $result = BasicType::whereRaw('type = 22 And del_time = 0 And top_depart_id = ' . $top_depart_id)->get()->toArray();
 
         if(! empty($result)){
             foreach ($result as $value){