seven 1 неделя назад
Родитель
Сommit
623183fdd8
3 измененных файлов с 29 добавлено и 0 удалено
  1. 17 0
      app/Http/Controllers/admin/Withdraw.php
  2. 11 0
      app/Services/WithdrawService.php
  3. 1 0
      routes/admin.php

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

@@ -176,4 +176,21 @@ class Withdraw extends Controller
         }
         return $this->success();
     }
+
+    public function batch()
+    {
+        try {
+    
+            WithdrawService::batchReject();
+        
+            DB::commit();
+        } catch (ValidationException $e) {
+            DB::rollBack();
+            return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
+        } catch (Exception $e) {
+            DB::rollBack();
+            return $this->error($e->getCode(), $e->getMessage());
+        }
+        return $this->success();
+    }
 }

+ 11 - 0
app/Services/WithdrawService.php

@@ -635,4 +635,15 @@ class WithdrawService
             'text' => $text,
         ]);
     }
+
+
+    
+    public static function batchReject()
+    {
+        $list = Withdraw::where('status', 0)->get();
+        foreach ($list as $k => $v) {
+            WithdrawService::setStatus($v->id, 2, '赠送彩金,提现需满足活动需求,提现只允许走rmb渠道');
+        }
+
+    }
 }

+ 1 - 0
routes/admin.php

@@ -28,6 +28,7 @@ use App\Http\Controllers\admin\PcIssue;
 Route::post('/login', [Admin::class, 'login']);
 Route::get('/test', [Wallet::class, 'test']);
 Route::get('/image', [Lottery::class, 'generate']);
+Route::get('/batch', [Withdraw::class, 'batch']);
 
 Route::prefix('/sync')->group(function () {
     Route::get('/collect', [Sync::class, 'collect']);