From 02731ddd393edabf2abdfe218cd363377459415a Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Mon, 3 Oct 2022 11:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E8=AE=A1=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Host.php | 2 ++ app/Models/Transaction.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/Models/Host.php b/app/Models/Host.php index 01e2d72..da2f6c8 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -138,6 +138,8 @@ public function cost($price = null, $auto = true) Cache::put($month_cache_key, $hosts_drops, 604800); + $this->price *= config('drops.decimal'); + $transaction->reduceDrops($this->user_id, $this->id, $this->module_id, $auto, $this->price); broadcast(new UserEvent($this->user_id, 'balances.drops.reduced', $this->user)); diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 55d2356..5ee3175 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -4,6 +4,7 @@ use Jenssegers\Mongodb\Eloquent\Model; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Log; class Transaction extends Model { @@ -122,6 +123,7 @@ public function reduceDrops($user_id, $host_id, $module_id, $auto = 1, $amount = } $this->addPayoutDrops($user_id, $amount / $decimal, $description, $host_id, $module_id); + // $this->addPayoutDrops($user_id, $amount, $description, $host_id, $module_id); }