改进 计费

This commit is contained in:
iVampireSP.com 2022-10-03 11:10:58 +08:00
parent 497b483526
commit 02731ddd39
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 4 additions and 0 deletions

View File

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

View File

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