Silent 6 years ago
parent
commit
9e0aa0a66d
1 changed files with 16 additions and 0 deletions
  1. 16 0
      app/Http/Controllers/Admin/SettingController.php

+ 16 - 0
app/Http/Controllers/Admin/SettingController.php

xqd
@@ -60,4 +60,20 @@ class SettingController extends Controller
 
         return view($this->view_path . 'system', compact('pre_uri', 'model', 'model_name', 'check_card_location', 'check_card_radius'));
     }
+
+    public function updateSystem(Request $request)
+    {
+        if(!$request->isMethod('POST')) {
+            return $this->showWarning('访问错误');
+        }
+
+        $items = collect(['check_card_location', 'check_card_radius']);
+
+        foreach($items as $item) {
+            if(!empty($request->input($item))) {
+                $this->model->where('key', $item)->update(['value' => $request->input($item)]);
+            }
+        }
+        return $this->showMessage('操作成功');
+    }
 }