|
@@ -3818,8 +3818,9 @@ class Database
|
|
|
}
|
|
|
} elseif (isset($param['sync']) && isset($param['api']) && $param['update'] != 'load') {
|
|
|
$param['sync']['dever-read'] = $data;
|
|
|
- $param['value'] = Dever::load($param['api'], $param['sync']);
|
|
|
+
|
|
|
if (is_array($param['update'])) {
|
|
|
+ $param['value'] = Dever::load($param['api'], $param['sync']);
|
|
|
$order = false;
|
|
|
if (isset($param['update'][0]) && is_string($param['update'][0]) && strstr($param['update'][0], '.')) {
|
|
|
if (isset($param['update'][1]) && $param['update'][1]) {
|
|
@@ -3840,6 +3841,8 @@ class Database
|
|
|
$param['lang'] = $config['manage']['lang'];
|
|
|
}
|
|
|
}
|
|
|
+ } elseif (isset($param['method'])) {
|
|
|
+ $param['value'] = Dever::load($param['api'] . '-' . $param['method'], $param['sync']);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3948,6 +3951,10 @@ class Database
|
|
|
$table .= $table_body . $table_header;
|
|
|
$table .= '</table>';
|
|
|
$result .= $table;
|
|
|
+
|
|
|
+ if (isset($param['update_show']) && $param['update_show']) {
|
|
|
+ //$result .= '<section class="order-sumary border-b">合计数量:111</section>';
|
|
|
+ }
|
|
|
} elseif (isset($param['update_type']) && $param['update_type'] == 3) {
|
|
|
$table = '<style>.layui-table .layui-input, .layui-table .xm-select-parent{width:100%}</style>';
|
|
|
$table .= '<table class="layui-table">';
|
|
@@ -4162,6 +4169,9 @@ class Database
|
|
|
if (isset($param['upload_search_value'])) {
|
|
|
$param['upload_search_value'] = $this->value($param['upload_search_value'], $data + $param);
|
|
|
}
|
|
|
+ if (isset($param['update_search_value'])) {
|
|
|
+ $param['update_search_value'] = $this->value($param['update_search_value'], $data + $param);
|
|
|
+ }
|
|
|
|
|
|
$param['where_id'] = $this->id;
|
|
|
|
|
@@ -4311,6 +4321,7 @@ class Database
|
|
|
|
|
|
$input = Dever::preInput('update_');
|
|
|
|
|
|
+ $info = array();
|
|
|
if ($this->id) {
|
|
|
# 新增权限
|
|
|
|
|
@@ -4415,9 +4426,10 @@ class Database
|
|
|
$m_col = $config['struct'][$h]['sync'][1];
|
|
|
if ($s_col == 'id') {
|
|
|
$s_value = $this->id;
|
|
|
+ } elseif (isset($info[$s_col])) {
|
|
|
+ $s_value = $info[$s_col];
|
|
|
} else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- $s_value = $s_one[$s_col];
|
|
|
+ $s_value = $input['update_' . $s_col];
|
|
|
}
|
|
|
$t = explode('-', $h);
|
|
|
$index = $t[0] . '/' . $t[1];
|
|
@@ -4451,16 +4463,15 @@ class Database
|
|
|
if ($this->id && $temp[1] == 'id') {
|
|
|
$update_id[$i][$index][$num]['id'] = $v;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
foreach ($config['struct'][$h]['sync'] as $ks => $vs) {
|
|
|
if ($vs == 'id') {
|
|
|
$vs = $this->id;
|
|
|
$update_col[$i][$index] = $ks;
|
|
|
+ } elseif (isset($info[$vs])) {
|
|
|
+ $vs = $info[$vs];
|
|
|
} else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- if (isset($s_one[$vs])) {
|
|
|
- $vs = $s_one[$vs];
|
|
|
- }
|
|
|
+ $vs = $input['update_' . $vs];
|
|
|
}
|
|
|
$update_add[$i][$index][$num]['add_' . $ks] = $vs;
|
|
|
$update_deletes[$i][$index][$ks] = $vs;
|
|
@@ -4499,15 +4510,17 @@ class Database
|
|
|
$k = str_replace('_', '', $temp[2]);
|
|
|
$update_other[$i][$temp[1]][$k] = $v;
|
|
|
} elseif (strpos($k, '-') && isset($config['struct'][$k]['sync'][0])) {
|
|
|
+ # 兼容处理,之后删除
|
|
|
$k = str_replace('update_', '', $k);
|
|
|
if (isset($config['struct'][$k]) && isset($config['struct'][$k]['sync'])) {
|
|
|
$s_col = $config['struct'][$k]['sync'][0];
|
|
|
$m_col = $config['struct'][$k]['sync'][1];
|
|
|
if ($s_col == 'id') {
|
|
|
$s_value = $this->id;
|
|
|
+ } elseif (isset($info[$s_col])) {
|
|
|
+ $s_value = $info[$s_col];
|
|
|
} else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- $s_value = $s_one[$s_col];
|
|
|
+ $s_value = $input['update_' . $s_col];
|
|
|
}
|
|
|
$temp = explode('-', $k);
|
|
|
$index = $temp[0] . '/' . $temp[1];
|
|
@@ -4531,9 +4544,10 @@ class Database
|
|
|
$m_col = $config['struct'][$k]['sync'][1];
|
|
|
if ($s_col == 'id') {
|
|
|
$s_value = $this->id;
|
|
|
- } else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- $s_value = $s_one[$s_col];
|
|
|
+ } elseif (isset($info[$s_col])) {
|
|
|
+ $s_value = $info[$s_col];
|
|
|
+ } else {
|
|
|
+ $s_value = $input['update_' . $s_col];
|
|
|
}
|
|
|
|
|
|
$index = $temp[0] . '/' . $temp[1];
|
|
@@ -4567,11 +4581,10 @@ class Database
|
|
|
if ($vs == 'id') {
|
|
|
$vs = $this->id;
|
|
|
$update_col[$i][$index] = $ks;
|
|
|
+ } elseif (isset($info[$vs])) {
|
|
|
+ $vs = $info[$vs];
|
|
|
} else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- if (isset($s_one[$vs])) {
|
|
|
- $vs = $s_one[$vs];
|
|
|
- }
|
|
|
+ $vs = $input['update_' . $vs];
|
|
|
}
|
|
|
$update_add[$i][$index][0]['add_' . $ks] = $vs;
|
|
|
$update_id[$i][$index][0][$ks] = $vs;
|
|
@@ -4592,11 +4605,10 @@ class Database
|
|
|
if ($vs == 'id') {
|
|
|
$vs = $this->id;
|
|
|
$update_col[$i][$index] = $ks;
|
|
|
+ } elseif (isset($info[$vs])) {
|
|
|
+ $vs = $info[$vs];
|
|
|
} else {
|
|
|
- $s_one = $this->load('one', $this->id);
|
|
|
- if (isset($s_one[$vs])) {
|
|
|
- $vs = $s_one[$vs];
|
|
|
- }
|
|
|
+ $vs = $input['update_' . $vs];
|
|
|
}
|
|
|
$up['add_' . $ks] = $vs;
|
|
|
$update_delete[$i][$index][][$ks] = $vs;
|