rabin 3 vuotta sitten
vanhempi
commit
392e1f3330
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      src/Database.php

+ 7 - 5
src/Database.php

@@ -3470,7 +3470,10 @@ class Database
             }
 
             $list = (isset($j['list']) && is_string($j['list']) && $j['list'] != 'table');
-            $update = (isset($j['update']) && is_string($j['update']) && $j['update'] != 'linkage');
+            $update = true;
+            if ($old) {
+                $update = (isset($j['update']) && is_string($j['update']) && $j['update'] != 'linkage');
+            }
 
             if (isset($data['where_' . $i]) && $data['where_' . $i]) {
                 $log[$j['name']] = $data['where_' . $i];
@@ -3519,7 +3522,7 @@ class Database
                         $old[$i] = Dever::array_decode($old[$i]);
                     }
                 }
-
+                
                 if (isset($j['option']) && !$list && $update) {
                     $name = array();
                     $option = $this->option($j['option']);
@@ -3544,14 +3547,13 @@ class Database
                     unset($log[$j['name']]);
                 }
 
-                /*
-                if (is_string($i) && strstr($i, 'area')) {
+                if ($old && strstr($i, 'area')) {
+                    print_r($old);die;
                     $old[$i] = Dever::load('area/api')->string($old[$i]);
                     if (isset($log[$j['name']]) && $log[$j['name']]) {
                         $log[$j['name']] = Dever::load('area/api')->string($log[$j['name']]);
                     }
                 }
-                */
 
                 if (isset($log[$j['name']]) && isset($old[$i]) && $old[$i] != $tlog[$j['name']] && $old[$i] != $log[$j['name']]) {
                     $log[$j['name']] = array('更新前' => $old[$i], '更新后' => $log[$j['name']]);