cqp пре 2 месеци
родитељ
комит
f28ba49a65
1 измењених фајлова са 13 додато и 13 уклоњено
  1. 13 13
      app/Service/ItemService.php

+ 13 - 13
app/Service/ItemService.php

@@ -144,11 +144,11 @@ class ItemService extends Service
             'device_list' => $receipt,
         ];
 
-        foreach ($detail as $key => $value) {
-            if (empty($value)) {
-                $detail[$key] = (object)[]; // 转成 stdClass 对象
-            }
-        }
+//        foreach ($detail as $key => $value) {
+//            if (empty($value)) {
+//                $detail[$key] = (object)[]; // 转成 stdClass 对象
+//            }
+//        }
 
         return $detail;
     }
@@ -254,14 +254,14 @@ class ItemService extends Service
         }
         list($status, $msg) = $this->checkArrayRepeat($data['man_list'],'data_id','人员');
         if(! $status) return [false, $msg];
-        if(empty($data['device_list'])) return [false, '设备不能为空'];
-        foreach ($data['device_list'] as $key => $value){
-            if(empty($value['type'])) return [false, '类型不能为空'];
-            if(empty($value['data_id'])) return [false, '设备ID不能为空'];
-            $data['device_list'][$key]['top_depart_id'] = $data['top_depart_id'];
-        }
-        list($status, $msg) = $this->checkArrayRepeat($data['device_list'],'data_id','设备');
-        if(! $status) return [false, $msg];
+//        if(empty($data['device_list'])) return [false, '设备不能为空'];
+//        foreach ($data['device_list'] as $key => $value){
+//            if(empty($value['type'])) return [false, '类型不能为空'];
+//            if(empty($value['data_id'])) return [false, '设备ID不能为空'];
+//            $data['device_list'][$key]['top_depart_id'] = $data['top_depart_id'];
+//        }
+//        list($status, $msg) = $this->checkArrayRepeat($data['device_list'],'data_id','设备');
+//        if(! $status) return [false, $msg];
 
         if($is_add){
             $bool = Item::where('code',$data['code'])