rabin 2 роки тому
батько
коміт
1b1266b3d3
1 змінених файлів з 12 додано та 11 видалено
  1. 12 11
      src/Database.php

+ 12 - 11
src/Database.php

@@ -4657,9 +4657,16 @@ class Database
             //print_r($update);die;
             $fast = Dever::input('fast');
             foreach ($update as $k => $v) {
-                if (!$fast && isset($config['manage']['update_check'])) {
-                    $update_check = explode(',', $config['manage']['update_check']);
-                    foreach ($update_check as $k1 => $v1) {
+                $method = 'insert';
+                $old = array();
+                if (isset($v['where_id']) && $v['where_id']) {
+                    $method = 'update';
+                    $old = $this->load('one', $v['where_id']);
+                }
+
+                if (!$fast && $method == 'insert' && isset($config['manage']['insert_check'])) {
+                    $insert_check = explode(',', $config['manage']['insert_check']);
+                    foreach ($insert_check as $k1 => $v1) {
                         if (strstr($v1, '-')) {
                             $t = explode('-', $v1);
                             $v1 = $t[0] . '/' . $t[1];
@@ -4669,12 +4676,6 @@ class Database
                         }
                     }
                 }
-                $method = 'insert';
-                $old = array();
-                if (isset($v['where_id']) && $v['where_id']) {
-                    $method = 'update';
-                    $old = $this->load('one', $v['where_id']);
-                }
                 if (isset($order[$k])) {
                     foreach ($order[$k] as $i => $j) {
                         array_multisort($j, SORT_ASC, $v[$i]);
@@ -4738,8 +4739,8 @@ class Database
 
                     $this->spec($id, $config);
 
-                    if (isset($config['manage']['update_end'])) {
-                        Dever::load($config['manage']['update_end'], $id);
+                    if ($method == 'insert' && isset($config['manage']['insert_end'])) {
+                        Dever::load($config['manage']['insert_end'], $id);
                     }
                 }
             }