mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-26 16:04:23 +00:00
fix yd order number bug
This commit is contained in:
+7
-11
@@ -153,7 +153,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
]);
|
||||
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
|
||||
|
||||
foreach($rows->data as $row){
|
||||
|
||||
$containerReference = null;
|
||||
@@ -166,6 +165,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
'trakingno' => $row->expressno
|
||||
]);
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
|
||||
|
||||
foreach ($rows->data as $trackingRow) {
|
||||
if($trackingRow->tracking === '货物已送达仓库准备入库中'){
|
||||
$receiveDate = Carbon::parse($trackingRow->trackingtime);
|
||||
@@ -186,20 +186,16 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
|
||||
|
||||
if (!array_key_exists(2, $customerno)){
|
||||
if (!array_key_exists(1, $customerno)){
|
||||
continue;
|
||||
}
|
||||
$customerno[2] = substr($customerno[1], -9);
|
||||
}
|
||||
|
||||
|
||||
$orderNumber = $customerno[2];
|
||||
$orderNumber = $customerno[array_key_last($customerno)];
|
||||
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
continue;
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$packingListReference = $row->expressno;
|
||||
|
||||
Reference in New Issue
Block a user