From 0139531973b3c35ccebaeb4e6ef8adf59aba40a6 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Mon, 30 Jan 2023 00:31:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/User.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/User.php b/app/Models/User.php index 36b98ca..0a29a22 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -5,6 +5,7 @@ // use Illuminate\Contracts\Auth\MustVerifyEmail; use App\Exceptions\User\BalanceNotEnoughException; use Carbon\Exceptions\InvalidFormatException; +use GeneaLabs\LaravelModelCaching\CachedBuilder; use GeneaLabs\LaravelModelCaching\Traits\Cachable; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Database\Eloquent\Casts\Attribute; @@ -143,7 +144,7 @@ public function user_group(): BelongsTo return $this->belongsTo(UserGroup::class); } - public function scopeBirthday(): User + public function scopeBirthday(): User|CachedBuilder { /** @noinspection PhpUndefinedMethodInspection */ return $this->select(['id', 'name', 'birthday_at', 'email_md5', 'created_at'])->whereMonth('birthday_at', now()->month)