改进 返回类型

This commit is contained in:
iVampireSP.com 2023-01-30 00:31:11 +08:00
parent 3f2d8599a8
commit 0139531973
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

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