From d72ebd4fdc3e54a7ca0c3379a84605194bc6cd35 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 27 Sep 2022 11:34:28 +0800 Subject: [PATCH] fix 1688 xpo --- routes/web.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 364fb6e7..46196c14 100644 --- a/routes/web.php +++ b/routes/web.php @@ -380,11 +380,14 @@ Route::get('/payments/manual', function(){ }); Route::get('/1688/fix', function(){ - $purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get(); - - foreach($purchaseOrderDocuments as $document){ - if($document->owner->status === ApprovalStatus::COMPLETED) continue; - (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner); - } + Booking::where('service_id', 4)->where('status', 2)->whereHas('transactions', function($query){ + return $query->where('type', TransactionType::PURCHASE_ORDER); + })->get(); +// $purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get(); +// +// foreach($purchaseOrderDocuments as $document){ +// if($document->owner->status === ApprovalStatus::COMPLETED) continue; +// (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner); +// } });