mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进代码
This commit is contained in:
@@ -618,7 +618,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
|
|
||||||
if ($cache) {
|
if ($cache) {
|
||||||
// 查找是否存在缓存
|
// 查找是否存在缓存
|
||||||
$name = basename(str_replace('\\', '/', get_called_class()));
|
$name = basename(str_replace('\\', '/', static::class));
|
||||||
$guid = md5('model_' . $name . '_' . serialize($data));
|
$guid = md5('model_' . $name . '_' . serialize($data));
|
||||||
$result = Cache::get($guid);
|
$result = Cache::get($guid);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@@ -873,7 +873,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
protected static function db()
|
protected static function db()
|
||||||
{
|
{
|
||||||
$model = get_called_class();
|
$model = static::class;
|
||||||
|
|
||||||
if (!isset(self::$links[$model])) {
|
if (!isset(self::$links[$model])) {
|
||||||
self::$links[$model] = Db::connect(static::$connection);
|
self::$links[$model] = Db::connect(static::$connection);
|
||||||
|
|||||||
Reference in New Issue
Block a user