日志修改
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user