lip 3 месяцев назад
Родитель
Сommit
5960dbe17c
2 измененных файлов с 5 добавлено и 7 удалено
  1. 2 6
      app/admin/controller/Complaint.php
  2. 3 1
      app/admin/validate/ComplaintValidate.php

+ 2 - 6
app/admin/controller/Complaint.php

@@ -62,16 +62,12 @@ class Complaint extends BaseController
         try {
             $params = (new ComplaintValidate())->post()->goCheck('edit');
             $id = $this->request->param('id',0);
-            
-            $language_code = $params['language_code'] ?? $this->lang;
-
+            $result = $params['result'] ?? '';
             $complaint = ComplaintModel::where('id', $id)->find();
             if (!$complaint) {
                 return $this->error('投诉项不存在');
             }
-            $complaint->name = $params['name'];
-            $complaint->weight = $params['weight'];
-            $complaint->language_code = $language_code;
+            $complaint->result = $result;
             $complaint->save();
         } catch (Exception $e) {
             return $this->error($e->getMessage());

+ 3 - 1
app/admin/validate/ComplaintValidate.php

@@ -14,6 +14,7 @@ class ComplaintValidate extends BaseValidate
     protected $rule = [
         'id' => 'require',
         'name' => 'require|length:1,100',
+        'result' => 'length:0,255',
         'weight' => 'require|integer|min:0',
     ];
 
@@ -24,6 +25,7 @@ class ComplaintValidate extends BaseValidate
     protected $field = [
         'id' => 'id',
         'name' => '投诉项',
+        'result' => '处理结果',
         'weight' => '权重',
     ];
 
@@ -32,7 +34,7 @@ class ComplaintValidate extends BaseValidate
      */
     public function sceneEdit()
     {
-        return $this->only(['name', 'weight', 'language_code']);
+        return $this->only(['id', 'result']);
     }
 
     public function sceneId()