mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-23 18:44:26 +08:00
重构初始化
This commit is contained in:
20
app/repository/system/config/SystemConfigRepository.php
Normal file
20
app/repository/system/config/SystemConfigRepository.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace app\repository\system\config;
|
||||
|
||||
use app\common\base\BaseRepository;
|
||||
use app\model\system\SystemConfig;
|
||||
|
||||
/**
|
||||
* 系统配置仓库。
|
||||
*/
|
||||
class SystemConfigRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new SystemConfig());
|
||||
}
|
||||
}
|
||||
32
app/repository/system/user/AdminUserRepository.php
Normal file
32
app/repository/system/user/AdminUserRepository.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\repository\system\user;
|
||||
|
||||
use app\common\base\BaseRepository;
|
||||
use app\model\admin\AdminUser;
|
||||
|
||||
/**
|
||||
* 管理员账号仓库。
|
||||
*/
|
||||
class AdminUserRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new AdminUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户名查询管理员。
|
||||
*/
|
||||
public function findByUsername(string $username, array $columns = ['*']): ?AdminUser
|
||||
{
|
||||
return $this->model->newQuery()
|
||||
->where('username', $username)
|
||||
->first($columns);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user