Ken 3 주 전
부모
커밋
0e294ee356
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/Http/Controllers/admin/Config.php
  2. 1 0
      app/Http/Controllers/admin/Rebate.php

+ 2 - 2
app/Http/Controllers/admin/Config.php

@@ -52,7 +52,7 @@ class Config extends Controller
         $id = request()->post('id', '');
         if ($id) {
             $validator = [
-                'field' => 'required|string|max:50|alpha_dash|unique:config,field,' . $id,
+                'id' => ['required', 'integer', 'min:1'],
                 'val' => 'nullable|string',
                 'remark' => 'required|nullable|string',
             ];
@@ -66,7 +66,7 @@ class Config extends Controller
 // 
 
 
-        request()->validate($validator);
+        $params = request()->validate($validator);
         $ret = ConfigService::submit($params);
         if ($ret['code'] == ConfigService::NOT) {
             return $this->error($ret['code'], $ret['msg']);

+ 1 - 0
app/Http/Controllers/admin/Rebate.php

@@ -35,6 +35,7 @@ class Rebate extends Controller
         }
         return $this->success($result);
     }
+
     public function store()
     {
         DB::beginTransaction();