From 21cffd0a0c680f7833f25154435d15af10b533da Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 6 Nov 2015 21:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=A7=86=E5=9B=BE=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=89=A9=E5=B1=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ThinkPHP/Library/Think/Model/ViewModel.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThinkPHP/Library/Think/Model/ViewModel.class.php b/ThinkPHP/Library/Think/Model/ViewModel.class.php index bfc4944..94f2599 100644 --- a/ThinkPHP/Library/Think/Model/ViewModel.class.php +++ b/ThinkPHP/Library/Think/Model/ViewModel.class.php @@ -45,7 +45,7 @@ class ViewModel extends Model $prefix = $this->tablePrefix; $tableName = preg_replace_callback("/__([A-Z_-]+)__/sU", function ($match) use ($prefix) {return $prefix . strtolower($match[1]);}, $tableName); } else { - $class = $key . 'Model'; + $class = parse_res_name($key, C('DEFAULT_M_LAYER')); $Model = class_exists($class) ? new $class() : M($key); $tableName .= $Model->getTableName(); } @@ -102,7 +102,7 @@ class ViewModel extends Model private function _checkFields($name, $fields) { if (false !== $pos = array_search('*', $fields)) { -// 定义所有字段 + // 定义所有字段 $fields = array_merge($fields, M($name)->getDbFields()); unset($fields[$pos]); } -- Gitee