From abb66a0e799e7ca613e8967a304e7c5ed00e034e Mon Sep 17 00:00:00 2001 From: chengkun <chengkun@ishangstudy.com> Date: Fri, 30 May 2025 11:37:48 +0800 Subject: [PATCH] 提交 --- app/public/common.php | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/app/public/common.php b/app/public/common.php index a46a5d7..7dfdb59 100644 --- a/app/public/common.php +++ b/app/public/common.php @@ -1030,7 +1030,7 @@ * @param int $tm 跳转时间 * @param string $type 1:后台操作 */ - function ACT_layer_msg(string $msg = "操作已成功!", int $st = 9, string $url = '', int $tm = 2, string $type = '0') { + function ACT_layer_msg($msg = "操作已成功!", $st = 9, $url = '', $tm = 2, $type = '0') { //解决ie9 $.get $.post 回调函数的返回值为undefine header("Content-Type: text/html; charset=UTF-8"); @@ -1061,7 +1061,7 @@ * @param string $tm 时间 * @param string $error */ - function layer_msg(string $msg, string $st = '9', string $type = '0', string $url = '', string $tm = '2', string $error = '0') { + function layer_msg($msg, $st = '9', $type = '0', $url = '', $tm = '2', $error = '0') { if ($type == '1') { $this->ACT_layer_msg($msg, $st, $url, $tm, $type); @@ -1105,42 +1105,33 @@ } public function MODEL($ModelName = NULL, $ModelPath = NULL) { -// var_dump($ModelName); -// var_dump($ModelPath); require_once(APP_PATH . 'app/public/action.class.php'); if ($ModelName) { if ($ModelPath) { if (file_exists($ModelPath . '/' . $ModelName . '.class.php')) { - require_once($ModelPath . '/' . $ModelName . '.class.php'); } else { - return NULL; } } else { - $ModelPath = APP_PATH . 'app/model/'; $ModelFileName = $ModelName . '.model.php'; if (file_exists($ModelPath . $ModelFileName)) { - require_once($ModelPath . $ModelFileName); } else { - return NULL; } } $ModelName = $ModelName . '_model'; } else { - $ModelName = 'model'; } -// var_dump($ModelName); -// exit(); + if (!class_exists($ModelName)) { return NULL; } - $Model = new $ModelName($this->db, $this->def, array('uid' => $this->uid, 'username' => $this->username, 'usertype' => $this->usertype), $this->tpl); - return $Model; + + return new $ModelName($this->db, $this->def, array('uid' => $this->uid, 'username' => $this->username, 'usertype' => $this->usertype), $this->tpl); } //获取描述 -- Gitblit v1.9.0