Commit 55c9648b authored by hangjun83's avatar hangjun83

openapi 震坤行邮件

parent 83f0cd2a
......@@ -117,12 +117,14 @@ class ZhenKhService
}
}
if($goodsList && count($goodsList['list']) > 0){
$sendContent = [
'params' => ['goods' => $goodsList['list']],
'consumer' => __CLASS__,
'method' => 'consumerBatchUpdateGoodsList'
];
SimpleKafka::produerSend($sendContent,'zkh');
foreach($goodsList['list'] as $goods){
$sendContent = [
'params' => ['goods' => $goods],
'consumer' => __CLASS__,
'method' => 'consumerBatchUpdateGoodsList'
];
SimpleKafka::produerSend($sendContent,'zkh');
}
}
$page ++;
......@@ -206,27 +208,26 @@ class ZhenKhService
if(!isset($params['goods']) || empty($params['goods'])){
return false;
}
$goods = $params['goods'];
foreach($params['goods'] as $goods) {
try {
$result = $this->rhawnService->updateZhenkhGoods($goods);
if(!is_null($result)){
//更新商品的价格和库存
SimpleKafka::produerSend([
'params' => ['goods' => $result],
'consumer' => __CLASS__,
'method' => 'consumerUpdateReportPriceAndStock'
],'zkh');
}
} catch (\Throwable $exception) {
$this->apiService->throwableAfter([
'platform_name' => $this->apiService->getPlatformInfo('platform_name'),
'queue_params' => $goods,
'fail_content' => $exception->getMessage(),
'queue_reset' => time() + 86400 * 10
]);
try {
$result = $this->rhawnService->updateZhenkhGoods($goods);
if(!is_null($result)){
//更新商品的价格和库存
SimpleKafka::produerSend([
'params' => ['goods' => $result],
'consumer' => __CLASS__,
'method' => 'consumerUpdateReportPriceAndStock'
],'zkh');
}
} catch (\Throwable $exception) {
$this->apiService->throwableAfter([
'platform_name' => $this->apiService->getPlatformInfo('platform_name'),
'queue_params' => $goods,
'fail_content' => $exception->getMessage(),
'queue_reset' => time() + 86400 * 10
]);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment