mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
fix yd tracking api json line break bug
This commit is contained in:
@@ -31,6 +31,7 @@ class FetchesDataFromYDPortal
|
||||
public function getResponseBody(ResponseInterface $request){
|
||||
$content = $request->getBody()->getContents();
|
||||
$content = str_replace("\r",'', $content);
|
||||
$content = str_replace("\n",'', $content);
|
||||
return json_decode($content);
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
$start = $start ? $start : Carbon::now()->subMonths(2);
|
||||
|
||||
$startLimit = Carbon::parse('01-12-2021');
|
||||
@@ -165,6 +166,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$trackingRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/ApiTracking.ashx', 'GET', [
|
||||
'trakingno' => $row->expressno
|
||||
]);
|
||||
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
|
||||
|
||||
foreach ($rows->data as $trackingRow) {
|
||||
|
||||
Reference in New Issue
Block a user