mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进Model类
This commit is contained in:
@@ -853,10 +853,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
|
|
||||||
if (!isset(self::$links[$model])) {
|
if (!isset(self::$links[$model])) {
|
||||||
self::$links[$model] = Db::connect(static::$connection);
|
self::$links[$model] = Db::connect(static::$connection);
|
||||||
}
|
|
||||||
if (isset(static::$tableName)) {
|
|
||||||
self::$links[$model]->setTable(static::$tableName);
|
self::$links[$model]->setTable(static::$tableName);
|
||||||
} else {
|
|
||||||
$name = basename(str_replace('\\', '/', $model));
|
$name = basename(str_replace('\\', '/', $model));
|
||||||
self::$links[$model]->name($name);
|
self::$links[$model]->name($name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user