Ken 23 ساعت پیش
والد
کامیت
e05dbd116f
1فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      app/Http/Controllers/admin/Wallet.php

+ 10 - 3
app/Http/Controllers/admin/Wallet.php

@@ -6,6 +6,7 @@ use App\Constants\HttpStatus;
 use App\Http\Controllers\Controller;
 use App\Models\Recharge;
 use App\Services\BalanceLogService;
+use App\Services\MenuService;
 use App\Services\RechargeService;
 use App\Services\TopUpService;
 use Exception;
@@ -52,14 +53,20 @@ class Wallet extends Controller
      */
     function getPendingTasks()
     {
+        $data['recharge_task'] = 0;
+        $data['withdraw_task'] = 0;
+        $data['rmb_withdraw_task'] = 0;
+
+
         $data['recharge_task'] = Recharge::where('type', 2)
             ->where('status', 0)->count();
         $data['withdraw_task'] = Withdraw::where('status', 0)->count();
-
-        $data['rmb_withdraw_task'] = PaymentOrder::where('type', 2)
-            ->where('status', 0)->count();
+        if (MenuService::checkMenu(request()->user->id, "admin/withdraw/rmb")) {
+            $data['rmb_withdraw_task'] = PaymentOrder::where('type', 2)
+                ->where('status', 0)->count();
 
 
+        }
         return $this->success($data);
     }