cqp 6 месяцев назад
Родитель
Сommit
d204d23ba5
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/Service/ExportFileService.php

+ 3 - 1
app/Service/ExportFileService.php

@@ -6,6 +6,7 @@ use App\Exports\ExportOrder;
 use App\Exports\MultiSheetExport;
 use App\Model\CalendarDetails;
 use App\Model\Device;
+use App\Model\DeviceDetails;
 use App\Model\Employee;
 use App\Model\EmployeeRole;
 use App\Model\Item;
@@ -267,7 +268,8 @@ class ExportFileService extends Service
 
         $item_total = Item::where('del_time', 0)->where('is_use', 1)->select('code', 'id','start_time','end_time')->get()->toArray();
 
-        $time_array = ItemDetails::where('del_time',0)
+        $time_array = DeviceDetails::where('del_time',0)
+            ->where('time', strtotime($ergs['month'] . '-01'))
             ->pluck('total_hours', 'device_id')
             ->all();
         // 生成起止时间行