From db328a022f326f6565559241e4567b22bead2b68 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Mon, 3 Oct 2022 10:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Transaction.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index e464b69..55d2356 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -113,12 +113,6 @@ public function reduceDrops($user_id, $host_id, $module_id, $auto = 1, $amount = $decimal = config('drops.decimal'); - $month = now()->month; - - Cache::increment('user_' . $user_id . '_month_' . $month . '_drops', $amount); - - $amount = $amount * $decimal; - Cache::decrement($cache_key, $amount); if ($auto) { @@ -145,6 +139,10 @@ public function addPayoutDrops($user_id, $amount, $description, $host_id, $modul 'module_id' => $module_id, ]; + $month = now()->month; + + Cache::increment('user_' . $user_id . '_month_' . $month . '_drops', $amount); + return $this->addLog($user_id, $data); }