cqp 3 月之前
父节点
当前提交
cc4aeab7c4
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Service/InspectService.php

+ 3 - 2
app/Service/InspectService.php

@@ -537,16 +537,17 @@ class InspectService extends Service
             ->where('equipment_id', $data['equipment_id'])
             ->where('crt_time','>=', strtotime(date('Y-m-d 00:00:00',time())))
             ->where('crt_time','<=', strtotime(date('Y-m-d 23:59:59',time())))
+            ->where('type', DeviceOrder::Model_type_one)
             ->select('device_order_id')
             ->get()->toArray();
-        if(empty($detail)) return [false, '该设备今天暂无巡检任务'];
+        if(empty($detail)) return [true, (object)[]];
         $device_order_id = array_unique(array_column($detail,'device_order_id'));
         $device_order_id = $device_order_id[0];
 
         $customer = DeviceOrder::where('del_time',0)
             ->where('id',$device_order_id)
             ->first();
-        if(empty($customer)) return [false,'单据不存在或已被删除'];
+        if(empty($customer)) return [true, (object)[]];
         $customer = $customer->toArray();
         $customer['type_title'] = DeviceOrder::$prefix_title[$customer['type']] ?? "";
         $customer['crt_title'] = Employee::where('id',$customer['crt_id'])->value('emp_name') ?? "王小波";