修改推送信息内容,修改请求处方平台超时时间
This commit is contained in:
@@ -44,29 +44,27 @@ class getProductCommand extends HyperfCommand
|
||||
$page_size = 100;
|
||||
$result = $prescription->getProd(1, 100);
|
||||
if (!empty($result['rows'])){
|
||||
$concurrent = new Concurrent(10);
|
||||
|
||||
foreach ($result['rows'] as $item) {
|
||||
$concurrent->create(function () use($item) {
|
||||
// 执行入库
|
||||
$this->handleData($item);
|
||||
});
|
||||
// 执行入库
|
||||
$this->handleData($item);
|
||||
}
|
||||
|
||||
$count = ceil($result['count'] / $page * $page_size);
|
||||
|
||||
if ($result['count'] > $page * $page_size) {
|
||||
for ($i = 2; $i < $count; $i++) {
|
||||
$result = $prescription->getProd($i, $page_size);
|
||||
if (!isset($result['rows'])){
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$result = $prescription->getProd($i, $page_size);
|
||||
if (!isset($result['rows'])){
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($result['rows'] as $item) {
|
||||
$concurrent->create(function () use($item) {
|
||||
foreach ($result['rows'] as $item) {
|
||||
// 执行入库
|
||||
$this->handleData($item);
|
||||
});
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
$this->line("部分商品更新失败:" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user