增加打印sql方法

This commit is contained in:
evoxwht 2023-07-06 18:09:24 +08:00
parent 04cf5d4df4
commit e77ab14af1

View File

@ -23,6 +23,7 @@ use app\services\system\lang\LangCodeServices;
use app\services\system\lang\LangCountryServices;
use think\facade\Config;
use think\facade\Log;
use think\facade\Db;
if (!function_exists('crmebLog')) {
/**
@ -1090,3 +1091,19 @@ if (!function_exists('out_push')) {
return true;
}
}
if (!function_exists('dump_sql')) {
/**
* 默认数据推送
* @param string $pushUrl
* @param array $data
* @param string $tip
* @return bool
*/
function dump_sql()
{
Db::listen(function ($sql) {
var_dump($sql);
});
}
}