feat: #10000 日志记录优化
This commit is contained in:
parent
161afade3d
commit
daa25bb3df
@ -72,7 +72,7 @@ abstract class BusinessClient
|
|||||||
$orderItem->update($item);
|
$orderItem->update($item);
|
||||||
}
|
}
|
||||||
// 增量更新库存
|
// 增量更新库存
|
||||||
if ($num) {
|
if ($num && $item['external_sku_id']) {
|
||||||
event(new BusinessOrdersUpdate($orderItem, $num));
|
event(new BusinessOrdersUpdate($orderItem, $num));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,6 +141,7 @@ abstract class BusinessClient
|
|||||||
$res = (new Client())->request($method, $url, $headers);
|
$res = (new Client())->request($method, $url, $headers);
|
||||||
$size = $res->getBody()->getSize();
|
$size = $res->getBody()->getSize();
|
||||||
$res = json_decode($res->getBody()->getContents(), true);
|
$res = json_decode($res->getBody()->getContents(), true);
|
||||||
|
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list'], true)) {
|
||||||
$log = new Log();
|
$log = new Log();
|
||||||
$log->module = 'plat';
|
$log->module = 'plat';
|
||||||
$log->action = $method;
|
$log->action = $method;
|
||||||
@ -152,8 +153,9 @@ abstract class BusinessClient
|
|||||||
$log->message = json_encode($res, 256) . '=====' . json_encode($params, 256);
|
$log->message = json_encode($res, 256) . '=====' . json_encode($params, 256);
|
||||||
}
|
}
|
||||||
$log->save();
|
$log->save();
|
||||||
|
}
|
||||||
if (isset($res['error_response'])) {
|
if (isset($res['error_response'])) {
|
||||||
throw new \RuntimeException($res['error_response']['error_msg']);
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user