Ken пре 2 недеља
родитељ
комит
e347aae3d5
1 измењених фајлова са 19 додато и 17 уклоњено
  1. 19 17
      app/Http/Controllers/admin/Withdraw.php

+ 19 - 17
app/Http/Controllers/admin/Withdraw.php

@@ -18,24 +18,26 @@ use App\Models\Config;
 
 class Withdraw extends Controller
 {
-function setRmbNote()
-{
-    try {
-        $params = request()->validate([
-            'id' => ['required', 'integer', 'min:1'],
-            'admin_note' => ['required', 'string', 'min:1', 'max:120'],
-        ]);
-        $po = PaymentOrder::where('id', $params['id'])->first();
-        if (!$po) throw new Exception("记录不存在", HttpStatus::CUSTOM_ERROR);
-        $po->admin_note = $params['admin_note'];
-        $po->save();
-    } catch (ValidationException $e) {
-        return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
-    } catch (Exception $e) {
-        return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
+    function setRmbNote()
+    {
+        try {
+            $params = request()->validate([
+                'id' => ['required', 'integer', 'min:1'],
+                'admin_note' => ['required', 'string', 'min:1', 'max:120'],
+            ]);
+            $po = PaymentOrder::where('id', $params['id'])
+                ->where('type', 2)->first();
+            if (!$po) throw new Exception("记录不存在", HttpStatus::CUSTOM_ERROR);
+            $po->admin_note = $params['admin_note'];
+            $po->save();
+        } catch (ValidationException $e) {
+            return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
+        } catch (Exception $e) {
+            return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
+        }
+        return $this->success();
     }
-    return $this->success();
-}
+
     public function rmb()
     {
         try {