Skip to content

Commit ea12261

Browse files
authored
Merge pull request #67 from teamones-open/fix_schema
fixed: 复用model对象要初始化数据
2 parents 15cce5c + 7e2262d commit ea12261

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/think/Loader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ public static function model($name = '', $layer = 'model', $appendSuffix = false
515515
$uid = $name . $layer;
516516

517517
if (isset(self::$_instance[$uid])) {
518-
return self::$_instance[$uid];
518+
$existModel = self::$_instance[$uid];
519+
$existModel->resetDefault();
520+
return $existModel;
519521
}
520522

521523
list($module, $class) = self::getModuleAndClass($name, $layer, $appendSuffix);

0 commit comments

Comments
 (0)