diff --git a/app/Http/Controllers/Remote/Host/HostController.php b/app/Http/Controllers/Remote/Host/HostController.php index 5c0cba7..028c79f 100644 --- a/app/Http/Controllers/Remote/Host/HostController.php +++ b/app/Http/Controllers/Remote/Host/HostController.php @@ -90,7 +90,7 @@ public function update(Request $request, Host $host) // if has cost_once if ($request->has('cost_once')) { - $host->cost($request->cost_once); + $host->cost($request->cost_once, false); return $this->updated($request->cost_once); } diff --git a/app/Models/Host.php b/app/Models/Host.php index 7f286b0..74dd48f 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -86,7 +86,7 @@ public function scopeThisUser($query, $module = null) // cost - public function cost($price = null) + public function cost($price = null, $auto = true) { $this->load('user'); @@ -137,7 +137,7 @@ public function cost($price = null) Cache::put($month_cache_key, $hosts_drops, 604800); - $transaction->reduceDrops($this->user_id, $this->id, $this->module_id, 1, $this->price); + $transaction->reduceDrops($this->user_id, $this->id, $this->module_id, $auto, $this->price); return true; }