代码优化

This commit is contained in:
wong
2025-11-20 11:48:31 +08:00
parent 3e78122659
commit 5a5160b92d

View File

@@ -75,7 +75,18 @@ if (!function_exists('requestCurl')) {
if (!function_exists('dataBuild')) {
function dataBuild($array)
{
return is_array($array) ? http_build_query($array) : $array;
if (!is_array($array)) {
return $array;
}
// 处理嵌套数组
foreach ($array as $key => $value) {
if (is_array($value)) {
$array[$key] = json_encode($value);
}
}
return http_build_query($array);
}
}
@@ -550,14 +561,15 @@ if (!function_exists('exit_data')) {
exit();
}
}
/**
* 调试打印变量但不终止程序
* @return void
*/
function dump()
{
call_user_func_array(['app\\common\\helper\\Debug', 'dump'], func_get_args());
if (!function_exists('dump')) {
/**
* 调试打印变量但不终止程序
* @return void
*/
function dump()
{
call_user_func_array(['app\\common\\helper\\Debug', 'dump'], func_get_args());
}
}
if (!function_exists('artificialAllotWechatFriend')) {