Silent 6 vuotta sitten
vanhempi
commit
9d9a8359e9

+ 3 - 2
app/Http/Controllers/Admin/SettingController.php

xqd xqd
@@ -68,10 +68,11 @@ class SettingController extends Controller
     {
         $check_card_location = $this->model->firstOrCreate(['key' => 'check_card_location'], ['value' => '39.916527,116.397128']);
         $check_card_radius = $this->model->firstOrCreate(['key' => 'check_card_radius'], ['value' => '1000']);
+        $check_position = $this->model->firstOrCreate(['key' => 'check_position'], ['value' => '1']);
 
         list($pre_uri, $model, $model_name) = array($this->pre_uri, $this->model, $this->model_name);
 
-        return view($this->view_path . 'system', compact('pre_uri', 'model', 'model_name', 'check_card_location', 'check_card_radius'));
+        return view($this->view_path . 'system', compact('pre_uri', 'model', 'model_name', 'check_card_location', 'check_card_radius', 'check_position'));
     }
 
     public function updateSystem(Request $request)
@@ -80,7 +81,7 @@ class SettingController extends Controller
             return $this->showWarning('访问错误');
         }
 
-        $items = collect(['check_card_location', 'check_card_radius']);
+        $items = collect(['check_card_location', 'check_card_radius', 'check_position']);
 
         foreach($items as $item) {
             if(!empty($request->input($item))) {

+ 12 - 0
resources/views/admin/settings/system.blade.php

xqd
@@ -37,6 +37,18 @@
                                 </div>
                             </div>
 
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-sm-offset-1 control-label">位置验证</label>
+                                <div class="col-sm-8">
+                                    <label class="radio-inline">
+                                        <input type="radio" name="check_position" value="1" {{ $check_position->value == 1 ? 'checked' : '' }}>是
+                                    </label>
+                                    <label class="radio-inline">
+                                        <input type="radio" name="check_position" value="0" {{ $check_position->value != 1 ? 'checked' : '' }}>否
+                                    </label>
+                                </div>
+                            </div>
+
                             <div class="form-group row">
                                 <div class="col-sm-8 col-sm-offset-3">
                                     <button type="submit" class="btn btn-sm btn-primary">保存设置</button>