cqp 3 місяців тому
батько
коміт
93f2672004
1 змінених файлів з 19 додано та 20 видалено
  1. 19 20
      app/Service/BasicTypeService.php

+ 19 - 20
app/Service/BasicTypeService.php

@@ -208,21 +208,22 @@ class BasicTypeService extends Service
             ->get()->toArray();
     }
 
-    public function maked(){
+    public function maked(){return;
         $list = BasicType::where('del_time',0)
             ->select('title','type','top_depart_id')
             ->get()->toArray();
         $basic_type2 = [];
         $basic_other_type = [];
+        $delete = [8,12,13,14,16,25,26,21,28,22,23,10];
         foreach ($list as $value){
+            if(in_array($value['type'], $delete)) continue;
+
             if($value['top_depart_id'] == 2){
-                if(! in_array($value['type'], [28,23,24,22,8])){
-                    $basic_type2[] = $value['title'] . '|' . $value['type'];
-                }
+                $basic_type2[] = $value['title'] . '|' . $value['type'];
             }else{
                 $basic_other_type[$value['top_depart_id']][] = $value['title'] . '|' . $value['type'];
             }
-        }dd($basic_type2);
+        }
         $depart = Depart::where('del_time',0)
             ->where('id','<>',2)
             ->where('parent_id',0)
@@ -234,21 +235,19 @@ class BasicTypeService extends Service
         $insert = [];
         $time = time();
         foreach ($depart as $value){
-            if(! empty($basic_other_type[$value])){
-                foreach ($basic_type2 as $val){
-                    if(! in_array($val,$basic_other_type[$value])) {
-                        $tmp = explode('|',$val);
-                        $insert[] = [
-                            'title' => $tmp[0],
-                            'type' => $tmp[1],
-                            'top_depart_id' => $value,
-                            'crt_time' => $time,
-                            'crt_id' => 1
-                        ];
-                    }
-                }
-            }else{
-                foreach ($basic_type2 as $val){
+            foreach ($basic_type2 as $val){
+                if(! empty($basic_other_type[$value])) {
+                    if(in_array($val,$basic_other_type[$value])) continue;
+
+                    $tmp = explode('|',$val);
+                    $insert[] = [
+                        'title' => $tmp[0],
+                        'type' => $tmp[1],
+                        'top_depart_id' => $value,
+                        'crt_time' => $time,
+                        'crt_id' => 1
+                    ];
+                }else{
                     $tmp = explode('|',$val);
                     $insert[] = [
                         'title' => $tmp[0],