|
@@ -220,6 +220,10 @@ class Database
|
|
if ($page_type) {
|
|
if ($page_type) {
|
|
$param .= '&page_type=' . $page_type . '';
|
|
$param .= '&page_type=' . $page_type . '';
|
|
}
|
|
}
|
|
|
|
+ $menu_id = Dever::input('menu_id');
|
|
|
|
+ if ($menu_id && !strstr($param, 'menu_id')) {
|
|
|
|
+ $param .= '&menu_id=' . $menu_id . '';
|
|
|
|
+ }
|
|
if (!$project) {
|
|
if (!$project) {
|
|
if ($key == 'add' || $key == 'update' || $key == 'delete' || $key == 'recovery') {
|
|
if ($key == 'add' || $key == 'update' || $key == 'delete' || $key == 'recovery') {
|
|
$project = $this->project;
|
|
$project = $this->project;
|
|
@@ -3248,7 +3252,7 @@ class Database
|
|
$this->load($method, $param);
|
|
$this->load($method, $param);
|
|
|
|
|
|
$struct = $this->struct_data($config['struct'], array($col => $value));
|
|
$struct = $this->struct_data($config['struct'], array($col => $value));
|
|
- Log::add($this->project, $this->table, array('method' => $method, 'input' => $struct, 'struct' => $config['struct']), $this->id);
|
|
|
|
|
|
+ Log::add($this->project, $this->table, $this->menu_id, '', $method, $struct, $this->id);
|
|
|
|
|
|
Dever::out('yes');
|
|
Dever::out('yes');
|
|
|
|
|
|
@@ -3417,7 +3421,7 @@ class Database
|
|
|
|
|
|
if ($id) {
|
|
if ($id) {
|
|
$struct = $this->struct_data($config['struct'], $v, $old);
|
|
$struct = $this->struct_data($config['struct'], $v, $old);
|
|
- Log::add($this->project, $this->table, array('method' => $method, 'input' => $struct), $this->id ? $this->id : $id);
|
|
|
|
|
|
+ Log::add($this->project, $this->table, $this->menu_id, '', $method, $struct, $id ? $id : $this->id);
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($update_other_id) && $update_other_id) {
|
|
if (isset($update_other_id) && $update_other_id) {
|
|
@@ -3442,6 +3446,11 @@ class Database
|
|
{
|
|
{
|
|
$log = $tlog = array();
|
|
$log = $tlog = array();
|
|
foreach ($struct as $i => $j) {
|
|
foreach ($struct as $i => $j) {
|
|
|
|
+ /*
|
|
|
|
+ if ($i == 'reorder' || $i == 'id') {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ */
|
|
if (isset($j['list_name'])) {
|
|
if (isset($j['list_name'])) {
|
|
$j['name'] = $j['list_name'];
|
|
$j['name'] = $j['list_name'];
|
|
} elseif (strpos($j['name'], '-')) {
|
|
} elseif (strpos($j['name'], '-')) {
|
|
@@ -3486,10 +3495,16 @@ class Database
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} elseif (strpos($log[$j['name']], 'http://wx.qlogo.cn/') !== false || strpos($log[$j['name']], '.jpg') !== false || strpos($log[$j['name']], '.gif') !== false || strpos($log[$j['name']], '.png') !== false) {
|
|
} elseif (strpos($log[$j['name']], 'http://wx.qlogo.cn/') !== false || strpos($log[$j['name']], '.jpg') !== false || strpos($log[$j['name']], '.gif') !== false || strpos($log[$j['name']], '.png') !== false) {
|
|
- $log[$j['name']] = '<img layer-src="' . $log[$j['name']] . '" src="' . $log[$j['name']] . '" width="150">';
|
|
|
|
|
|
+ $old[$i] = Dever::pic($old[$i]);
|
|
|
|
|
|
- if (isset($old[$i]) && $old[$i]) {
|
|
|
|
- $old[$i] = '<img layer-src="' . $old[$i] . '" src="' . $old[$i] . '" width="150">';
|
|
|
|
|
|
+ if ($old[$i] != $log[$j['name']]) {
|
|
|
|
+ $log[$j['name']] = '<img layer-src="' . $log[$j['name']] . '" src="' . $log[$j['name']] . '" width="150">';
|
|
|
|
+
|
|
|
|
+ if (isset($old[$i]) && $old[$i]) {
|
|
|
|
+ $old[$i] = '<img layer-src="' . $old[$i] . '" src="' . $old[$i] . '" width="150">';
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $old[$i] = $log[$j['name']] = '<img layer-src="' . $log[$j['name']] . '" src="' . $log[$j['name']] . '" width="150">';
|
|
}
|
|
}
|
|
|
|
|
|
} elseif (is_numeric($log[$j['name']]) && (strpos($i, 'time') !== false || strpos($i, 'date') !== false)) {
|
|
} elseif (is_numeric($log[$j['name']]) && (strpos($i, 'time') !== false || strpos($i, 'date') !== false)) {
|
|
@@ -3498,10 +3513,10 @@ class Database
|
|
$old[$i] = date("Y-m-d H:i:s", $old[$i]);
|
|
$old[$i] = date("Y-m-d H:i:s", $old[$i]);
|
|
}
|
|
}
|
|
} elseif (isset($j['decode'])) {
|
|
} elseif (isset($j['decode'])) {
|
|
- $log[$j['name']] = json_decode(base64_decode($log[$j['name']]), true);
|
|
|
|
|
|
+ $log[$j['name']] = Dever::array_decode($log[$j['name']]);
|
|
|
|
|
|
if (isset($old[$i]) && $old[$i]) {
|
|
if (isset($old[$i]) && $old[$i]) {
|
|
- $old[$i] = json_decode(base64_decode($old[$i]), true);
|
|
|
|
|
|
+ $old[$i] = Dever::array_decode($old[$i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3525,8 +3540,14 @@ class Database
|
|
$log[$j['name']] = implode(',', $name);
|
|
$log[$j['name']] = implode(',', $name);
|
|
}
|
|
}
|
|
|
|
|
|
- if (isset($old[$i]) && $old[$i] != $tlog[$j['name']]) {
|
|
|
|
- $log[$j['name']] = array('old' => $old[$i], 'new' => $log[$j['name']]);
|
|
|
|
|
|
+ if ($log[$j['name']] == 'null') {
|
|
|
|
+ unset($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']]);
|
|
|
|
+ } elseif ($old) {
|
|
|
|
+ //unset($log[$j['name']]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3547,10 +3568,15 @@ class Database
|
|
|
|
|
|
$config = $this->config();
|
|
$config = $this->config();
|
|
if (isset($config['struct']['state']) && (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete']))) {
|
|
if (isset($config['struct']['state']) && (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete']))) {
|
|
|
|
+ $name = '逻辑删除';
|
|
$this->load('update', array('where_id' => $this->id, 'state' => 2));
|
|
$this->load('update', array('where_id' => $this->id, 'state' => 2));
|
|
} else {
|
|
} else {
|
|
|
|
+ $name = '物理删除';
|
|
$this->load('delete', $this->id);
|
|
$this->load('delete', $this->id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Log::add($this->project, $this->table, $this->menu_id, '', 3, array('ID' => $this->id, '方式' => $name), $this->id);
|
|
|
|
+
|
|
return 'reload';
|
|
return 'reload';
|
|
return 'reloaderror';
|
|
return 'reloaderror';
|
|
}
|
|
}
|
|
@@ -3568,6 +3594,8 @@ class Database
|
|
|
|
|
|
$this->load('update', array('where_id' => $this->id, 'state' => 1));
|
|
$this->load('update', array('where_id' => $this->id, 'state' => 1));
|
|
|
|
|
|
|
|
+ Log::add($this->project, $this->table, $this->menu_id, '', 4, array('ID' => $this->id, '方式' => '逻辑恢复'), $this->id);
|
|
|
|
+
|
|
return 'reload';
|
|
return 'reload';
|
|
}
|
|
}
|
|
|
|
|