|
|
|
@ -2,7 +2,9 @@ |
|
|
|
|
|
|
|
namespace App\Exports; |
|
|
|
|
|
|
|
use App\Models\ParkingPatternSpace; |
|
|
|
use App\Models\ParkingSpace; |
|
|
|
use App\Services\EventCalendarService; |
|
|
|
use App\Services\OperationLogService; |
|
|
|
use App\Services\ParkingSpaceService; |
|
|
|
use Maatwebsite\Excel\Concerns\FromArray; |
|
|
|
@ -15,7 +17,11 @@ class ParkingSpaceExport implements FromArray, WithHeadings |
|
|
|
{ |
|
|
|
$data = []; |
|
|
|
$index = 1; |
|
|
|
ParkingSpace::all()->each( |
|
|
|
$query = ParkingSpace::query(); |
|
|
|
$pattern_id = EventCalendarService::getTargetModeId(); |
|
|
|
$spaceIds = ParkingPatternSpace::getParkingSpaceIds($pattern_id); |
|
|
|
$query->whereIn('id', $spaceIds); |
|
|
|
$query->select()->get()->each( |
|
|
|
function ($item) use (&$data, &$index) { |
|
|
|
$oldItem = (new ParkingSpaceService( |
|
|
|
new OperationLogService() |
|
|
|
|