cqp hace 1 semana
padre
commit
63a28b1ff9
Se han modificado 2 ficheros con 5 adiciones y 0 borrados
  1. 2 0
      app/Service/ExportFileService.php
  2. 3 0
      app/Service/StatisticsService.php

+ 2 - 0
app/Service/ExportFileService.php

@@ -401,6 +401,8 @@ class ExportFileService extends Service
                 $join->on('rc.employee_id_2', '=', 'employee_index.employee_id')
                     ->where('rc.del_time', 0)
                     ->where('rc.order_type', $type)
+                    ->whereNotNull('rc.employee_id_2')
+                    ->where('rc.employee_id_2', '<>', '')
                     ->whereRaw('rc.order_time >= employee_index.start_time')
                     ->whereRaw('rc.order_time <= employee_index.end_time');
             })

+ 3 - 0
app/Service/StatisticsService.php

@@ -218,10 +218,13 @@ class StatisticsService extends Service
         $model = EmployeeIndex::Clear($user, $data)
             ->where('employee_index.del_time', 0)
             ->where('employee_index.type', EmployeeIndex::TYPE_THREE)
+
             ->leftJoin(DB::raw('revenue_cost as rc'), function ($join) use ($type) {
                 $join->on('rc.employee_id_2', '=', 'employee_index.employee_id')
                     ->where('rc.del_time', 0)
                     ->where('rc.order_type', $type)
+                    ->whereNotNull('rc.employee_id_2')
+                    ->where('rc.employee_id_2', '<>', '')
                     ->whereRaw('rc.order_time >= employee_index.start_time')
                     ->whereRaw('rc.order_time <= employee_index.end_time');
             })