request->isPost()) { $item = input('post.item/a'); $img = input('post.img'); $imgwechat_img = input('post.imgwechat_img'); $resume = input('post.fileresume'); $clause = input('post.fileclause'); $system = MSystem::getSystem(); if (empty($system)) { if (!empty($img)) { $item['mark_img'] = $img; } if (!empty($imgwechat_img)) { $item['wechat_img'] = $imgwechat_img; } $system = MSystem::create($item); Log::write('system', 'index', "系统设置,ID:{$system->id}"); } else { if (!empty($img)) { Image::delImg($system['mark_img']); $item['mark_img'] = $img; } if (!empty($resume)){ $item['resume'] = $resume; } if (!empty($clause)){ $item['clause'] = $clause; } if (!empty($imgwechat_img)) { $item['wechat_img'] = $imgwechat_img; } MSystem::update($item, ['id' => $system['id']]); Log::write('system', 'index', "系统设置,ID:{$system['id']}"); } return $this->json(); } else { $item = MSystem::getSystem(); $positions = Image::getMarkPosition(); $this->data['item'] = $item; $this->data['positions'] = $positions; return $this->view(); } } public function other() { return $this->view(); } public function clearCache() { Cache::clear(); $cachePath = app()->getRuntimePath() . 'cache'; $tempPath = app()->getRuntimePath() . 'temp'; Tool::removeByPath($cachePath); Tool::removeByPath($tempPath); clearstatcache(); return $this->json(); } }