select([])->fetchAll(); } elseif ($value == 2) { $option = Dever::db('crop', 'image')->select([])->fetchAll(); } elseif ($value == 3) { $option = Dever::db('water_pic', 'image')->select([])->fetchAll(); } elseif ($value == 4) { $option = Dever::db('water_txt', 'image')->select([])->fetchAll(); } $result['type_id']['type'] = 'select'; $result['type_id']['option'] = $option; $result['type_id']['value'] = $option[0]['id'] ?? ''; return $result; } # 删除文件 public function delFile($id, $file) { $info = pathinfo($file); $file = explode('.', $info['filename']); $file = $file[0]; return Dever::db('file', 'upload')->update(array('rule_id' => $id, 'name' => $file), array('status' => 2)); } # 添加文件 public function addFile($id, $url, $file, $source, $name, $size) { $data = Dever::load('save', 'upload')->init($id)->addFile($url, $source, $name, $file, $size); return $data; } }