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); }