rabin 1 год назад
Родитель
Сommit
409099a3d7
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      src/Dever/Library.php
  2. 2 2
      src/Dever/Model.php

+ 2 - 2
src/Dever/Library.php

@@ -29,7 +29,7 @@ class Library
             $class = str_replace('/', '\\', $class);
         } else {
             $class = ucfirst($file);
-            $file = $path . DIRECTORY_SEPARATOR . ucfirst($file);
+            $file = $path . DIRECTORY_SEPARATOR . $file;
         }
         $class = ucfirst($app) . '\\' . ucfirst($path) . '\\' . $class;
         if (empty(self::$load[$class])) {
@@ -40,7 +40,7 @@ class Library
     }
     public static function load($class, $app, $path)
     {
-        $class = self::apply($class, $app, $path);
+        $class = self::apply(ucfirst($class), $app, $path);
         if (empty(self::$class[$class])) {
             self::$class[$class] = new $class();
         }

+ 2 - 2
src/Dever/Model.php

@@ -310,8 +310,8 @@ class Model
         $where[$config[0]] = $config[1];
         $data = $this->select($where, $set);
         if ($data) {
-            foreach ($data as &$v) {
-                if ($func) $v = call_user_func($func, $v);
+            foreach ($data as $k => &$v) {
+                if ($func) $v = call_user_func($func, $k, $v);
                 $config[1] = $v[$config[2]];
                 $child = $this->tree($where, $config, $func, $set);
                 if ($child) {