rabin 8 months ago
parent
commit
87b57aea20
1 changed files with 3 additions and 3 deletions
  1. 3 3
      boot.php

+ 3 - 3
boot.php

@@ -59,7 +59,7 @@ class Dever
         } elseif (strpos($class, '-')) {
             list($class, $method) = explode('-', $class);
             $call = 'db';
-            if (!$path) $path = 'default';
+            if (!$path) $path = true;
         }
         return self::$call($class, '', $path)->$method(...$param);
     }
@@ -79,7 +79,7 @@ class Dever
         }
         return self::$data[$index];
     }
-    public static function db($table, $app = '', $store = 'default', $partition = false, $path = 'table')
+    public static function db($table, $app = '', $cache = true, $store = 'default', $partition = false, $path = 'table')
     {
         if (strpos($table, '/') && !$app) {
             list($app, $table) = explode('/', $table);
@@ -90,7 +90,7 @@ class Dever
             $app = self::$app[0];
         }
         $index = $app . $path . $table;
-        if (empty(self::$data[$index])) {
+        if (empty(self::$data[$index]) || !$cache) {
             self::$data[$index] = new Dever\Model($table, $app, $store, $partition, $path);
         }
         return self::$data[$index];