Procházet zdrojové kódy

增加打印sql方法

evoxwht před 2 roky
rodič
revize
e77ab14af1
1 změnil soubory, kde provedl 17 přidání a 0 odebrání
  1. 17 0
      crmeb/app/common.php

+ 17 - 0
crmeb/app/common.php

@@ -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);
+        });
+    }
+}