mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 18:30:16 +08:00
34 lines
697 B
PHP
34 lines
697 B
PHP
<?php
|
|
/**
|
|
* This service file is part of item.
|
|
*
|
|
* @author ctexthuang
|
|
* @contact ctexthuang@qq.com
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Model\AdminUser;
|
|
|
|
/**
|
|
* Class AdminUserRepository
|
|
* @extends BaseRepository<AdminUser>
|
|
*/
|
|
final class AdminUserRepository extends BaseRepository
|
|
{
|
|
public function __construct(protected readonly AdminUser $model) {}
|
|
|
|
/**
|
|
* @param string $username
|
|
* @return AdminUser|null
|
|
*/
|
|
public function findByUserName(string $username): AdminUser|null
|
|
{
|
|
// @phpstan-ignore-next-line
|
|
return $this->model->newQuery()
|
|
->where('username', $username)
|
|
->first();
|
|
}
|
|
} |