改进 Host autocost

This commit is contained in:
iVampireSP.com 2022-09-15 20:57:36 +08:00
parent a9d61c3116
commit 862b437ad5
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 3 additions and 3 deletions

View File

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

View File

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