mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
feat: #10000 批量同步修改
This commit is contained in:
parent
9e4023afad
commit
c7b595598f
@ -73,6 +73,7 @@ class InventoryImport implements ToCollection, SkipsEmptyRows
|
|||||||
$goodsSku->stock = 0;
|
$goodsSku->stock = 0;
|
||||||
$goodsSku->save();
|
$goodsSku->save();
|
||||||
}
|
}
|
||||||
|
sleep(2);
|
||||||
event(new StockUpdateEvent($onSkuIds, 1));
|
event(new StockUpdateEvent($onSkuIds, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ use App\Models\Shop;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use GuzzleHttp\Promise;
|
use GuzzleHttp\Promise;
|
||||||
|
use Illuminate\Support\Facades\Log as LogFile;
|
||||||
|
|
||||||
abstract class BusinessClient
|
abstract class BusinessClient
|
||||||
{
|
{
|
||||||
@ -163,6 +164,7 @@ abstract class BusinessClient
|
|||||||
|
|
||||||
public function batchAsyncPostRequest($url, $batchParams)
|
public function batchAsyncPostRequest($url, $batchParams)
|
||||||
{
|
{
|
||||||
|
LogFile::info(json_encode($batchParams, 256));
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
$promises = [];
|
$promises = [];
|
||||||
foreach ($batchParams as $param) {
|
foreach ($batchParams as $param) {
|
||||||
@ -172,10 +174,9 @@ abstract class BusinessClient
|
|||||||
];
|
];
|
||||||
$promises[] = $client->postAsync($url, $options);
|
$promises[] = $client->postAsync($url, $options);
|
||||||
}
|
}
|
||||||
Promise\Utils::unwrap($promises);
|
$res = Promise\Utils::unwrap($promises);
|
||||||
// $res = Promise\Utils::unwrap($promises);
|
foreach ($res as $item) {
|
||||||
// foreach ($res as $item) {
|
LogFile::info($item->getBody()->getContents());
|
||||||
// var_dump($item->getBody()->getContents());
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user