chengkun
2025-05-30 abb66a0e799e7ca613e8967a304e7c5ed00e034e
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);
    }
    
    //获取描述