|
@@ -18,7 +18,16 @@ class Update extends Page
|
|
|
$this->setting('field', $data['update'], true, 'text');
|
|
|
foreach ($data['update'] as $k => $v) {
|
|
|
if ($v['type'] == 'tree' || $v['type'] == 'upload' || $v['type'] == 'cascader' || $v['type'] == 'checkbox' || isset($v['multiple'])) {
|
|
|
- $v['value'] = array();
|
|
|
+ if (isset($v['value']) && $v['value']) {
|
|
|
+ $v['value'] = explode(',', $v['value']);
|
|
|
+ foreach ($v['value'] as $k1 => $v1) {
|
|
|
+ if (is_numeric($v1)) {
|
|
|
+ $v['value'][$k1] = (float) $v1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $v['value'] = array();
|
|
|
+ }
|
|
|
}
|
|
|
if (isset($v['source'])) {
|
|
|
$source[$v['key']] = $v['source'];
|
|
@@ -393,7 +402,10 @@ class Update extends Page
|
|
|
}
|
|
|
if ($data) {
|
|
|
$this->exists($id, $data, $this->config['field']);
|
|
|
- $this->start($id, $data);
|
|
|
+ $result = $this->start($id, $data);
|
|
|
+ if ($result == 'end') {
|
|
|
+ return '操作成功';
|
|
|
+ }
|
|
|
if ($id) {
|
|
|
$info = $this->db->find($id);
|
|
|
if ($info) {
|
|
@@ -490,7 +502,14 @@ class Update extends Page
|
|
|
$result = Dever::call($this->config['start'], array($this->db, $data));
|
|
|
}
|
|
|
if ($result) {
|
|
|
- $data = $result;
|
|
|
+ if ($result == 'end') {
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+ if (is_object($result)) {
|
|
|
+ $this->db = $result;
|
|
|
+ } else {
|
|
|
+ $data = $result;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|