日志修改

This commit is contained in:
2025-10-16 15:00:42 +08:00
parent c26095df31
commit e5015f1981
7 changed files with 161 additions and 99 deletions

View File

@@ -102,7 +102,7 @@ if (!function_exists('curl_post')) {
{
$postData = json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
if(!empty($params['shopId'])) {
Log::write('耗材预警提交json' . $postData);
\support\Log::info('curl_post--->' . $postData);
}
$opts = array(
CURLOPT_TIMEOUT => 30,
@@ -120,6 +120,7 @@ if (!function_exists('curl_post')) {
$responsedata = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
\support\Log::info('curl_post_结果--->' . $responsedata);
return $responsedata;
}
}
@@ -159,11 +160,8 @@ if (!function_exists('replace_json_keys')) {
{
$originalData = json_decode($originalJson, true);
$mapData = json_decode($mapJson, true);
$reverseMap = array_flip($mapData);
$newData = [];
foreach ($originalData as $oldKey => $value) {
// 如果原始键在映射中存在,则替换为对应的新键;否则保留原键
$newKey = $reverseMap[$oldKey] ?? $oldKey;