永久 保存数据

This commit is contained in:
iVampireSP.com 2022-12-12 11:55:08 +08:00
parent 3a1e4d1fdd
commit c71e41371b
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -68,11 +68,10 @@
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host whereUpdatedAt($value) * @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host whereUpdatedAt($value)
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host whereUserId($value) * @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host whereUserId($value)
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host withCacheCooldownSeconds(?int $seconds = null) * @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Host withCacheCooldownSeconds(?int $seconds = null)
* @mixin \Eloquent
*/ */
class Host extends Model class Host extends Model
{ {
use HasFactory, Cachable; use Cachable;
protected $table = 'hosts'; protected $table = 'hosts';
@ -350,7 +349,7 @@ public function addLog(float|null $amount = 0): bool
} }
// 保存 1 年 // 保存 1 年
Cache::put($cache_key, $earnings, 24 * 60 * 60 * 365); Cache::forever($cache_key, $earnings);
/** 统计收益结束 */ /** 统计收益结束 */