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', '');
         $id = request()->post('id', '');
         if ($id) {
         if ($id) {
             $validator = [
             $validator = [
-                'field' => 'required|string|max:50|alpha_dash|unique:config,field,' . $id,
+                'id' => ['required', 'integer', 'min:1'],
                 'val' => 'nullable|string',
                 'val' => 'nullable|string',
                 'remark' => 'required|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);
         $ret = ConfigService::submit($params);
         if ($ret['code'] == ConfigService::NOT) {
         if ($ret['code'] == ConfigService::NOT) {
             return $this->error($ret['code'], $ret['msg']);
             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);
         return $this->success($result);
     }
     }
+
     public function store()
     public function store()
     {
     {
         DB::beginTransaction();
         DB::beginTransaction();