瀏覽代碼

摄像头导入修改

任敬轩 2 年之前
父節點
當前提交
a73c59f780
共有 1 個文件被更改,包括 14 次插入3 次删除
  1. 14 3
      Modules/Camera/Jobs/CameraListExcels.php

+ 14 - 3
Modules/Camera/Jobs/CameraListExcels.php

@@ -41,10 +41,11 @@ class CameraListExcels implements ShouldQueue
 
     protected function fieldsMap($rows)
     {
+
         //矿区信息
         $mine_name = trim($rows[0][0]);
         $area_name = isset($rows[0][1]) ? trim($rows[0][1]) : '';
-
+        Log::info($area_name);
         $mine_parent_id = MineList::where('title', $mine_name)->value('id');
         if (!$mine_parent_id) {
             return false;
@@ -53,7 +54,8 @@ class CameraListExcels implements ShouldQueue
         if (!$area_name) {
             $mine_id = $mine_parent_id;
         } else {
-            $mine_list = MineList::where(
+
+            $mine_list_all = MineList::where(
                 [
                     'title'     => $area_name,
                 ]
@@ -62,7 +64,13 @@ class CameraListExcels implements ShouldQueue
                     'id',
                     'degree'
                 ]
-            )->first();
+            )->get();
+
+            foreach($mine_list_all as $k=>$v){
+                if(explode('|', $v->degree)[0] == $mine_parent_id){
+                    $mine_list = $v;
+                }
+            }
 
             if (!$mine_list) {
                 return false;
@@ -80,6 +88,9 @@ class CameraListExcels implements ShouldQueue
         }
 
         $data = [];
+        Log::info('****************************************');
+        Log::info($rows);
+        Log::info('****************************************');
         foreach ($rows as $index => $item) {
             if ($index == 0 || $index == 1) {
                 continue;