改进 Host autocost
This commit is contained in:
parent
a9d61c3116
commit
862b437ad5
@ -90,7 +90,7 @@ public function update(Request $request, Host $host)
|
|||||||
|
|
||||||
// if has cost_once
|
// if has cost_once
|
||||||
if ($request->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);
|
return $this->updated($request->cost_once);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public function scopeThisUser($query, $module = null)
|
|||||||
|
|
||||||
|
|
||||||
// cost
|
// cost
|
||||||
public function cost($price = null)
|
public function cost($price = null, $auto = true)
|
||||||
{
|
{
|
||||||
$this->load('user');
|
$this->load('user');
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ public function cost($price = null)
|
|||||||
|
|
||||||
Cache::put($month_cache_key, $hosts_drops, 604800);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user