diff --git a/app/Imports/InventoryImport.php b/app/Imports/InventoryImport.php index 4e087b4..1feb3e6 100644 --- a/app/Imports/InventoryImport.php +++ b/app/Imports/InventoryImport.php @@ -73,6 +73,7 @@ class InventoryImport implements ToCollection, SkipsEmptyRows $goodsSku->stock = 0; $goodsSku->save(); } + sleep(2); event(new StockUpdateEvent($onSkuIds, 1)); } } diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index 90c47af..f1e7ba4 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -12,6 +12,7 @@ use App\Models\Shop; use GuzzleHttp\Client; use Illuminate\Support\Facades\Auth; use GuzzleHttp\Promise; +use Illuminate\Support\Facades\Log as LogFile; abstract class BusinessClient { @@ -163,6 +164,7 @@ abstract class BusinessClient public function batchAsyncPostRequest($url, $batchParams) { + LogFile::info(json_encode($batchParams, 256)); $client = new Client(); $promises = []; foreach ($batchParams as $param) { @@ -172,10 +174,9 @@ abstract class BusinessClient ]; $promises[] = $client->postAsync($url, $options); } - Promise\Utils::unwrap($promises); -// $res = Promise\Utils::unwrap($promises); -// foreach ($res as $item) { -// var_dump($item->getBody()->getContents()); -// } + $res = Promise\Utils::unwrap($promises); + foreach ($res as $item) { + LogFile::info($item->getBody()->getContents()); + } } }