Commit 55c9648b authored by hangjun83's avatar hangjun83

openapi 震坤行邮件

parent 83f0cd2a
...@@ -117,12 +117,14 @@ class ZhenKhService ...@@ -117,12 +117,14 @@ class ZhenKhService
} }
} }
if($goodsList && count($goodsList['list']) > 0){ if($goodsList && count($goodsList['list']) > 0){
$sendContent = [ foreach($goodsList['list'] as $goods){
'params' => ['goods' => $goodsList['list']], $sendContent = [
'consumer' => __CLASS__, 'params' => ['goods' => $goods],
'method' => 'consumerBatchUpdateGoodsList' 'consumer' => __CLASS__,
]; 'method' => 'consumerBatchUpdateGoodsList'
SimpleKafka::produerSend($sendContent,'zkh'); ];
SimpleKafka::produerSend($sendContent,'zkh');
}
} }
$page ++; $page ++;
...@@ -206,27 +208,26 @@ class ZhenKhService ...@@ -206,27 +208,26 @@ class ZhenKhService
if(!isset($params['goods']) || empty($params['goods'])){ if(!isset($params['goods']) || empty($params['goods'])){
return false; return false;
} }
$goods = $params['goods'];
foreach($params['goods'] as $goods) { try {
try { $result = $this->rhawnService->updateZhenkhGoods($goods);
$result = $this->rhawnService->updateZhenkhGoods($goods); if(!is_null($result)){
if(!is_null($result)){ //更新商品的价格和库存
//更新商品的价格和库存 SimpleKafka::produerSend([
SimpleKafka::produerSend([ 'params' => ['goods' => $result],
'params' => ['goods' => $result], 'consumer' => __CLASS__,
'consumer' => __CLASS__, 'method' => 'consumerUpdateReportPriceAndStock'
'method' => 'consumerUpdateReportPriceAndStock' ],'zkh');
],'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
]);
} }
} 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