mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-03-24 20:04:32 +08:00
更新
This commit is contained in:
@@ -16,6 +16,10 @@ MPay V2 Webman 是一个采用 Webman 高性能 PHP 框架构建的支付系统
|
||||
- **缓存**: Redis
|
||||
- **认证**: JWT
|
||||
|
||||
## 图片展示
|
||||
<img src="doc/img/1.png" width=640 />
|
||||
<img src="doc/img/2.png" width=640 />
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
|
||||
19
app/repositories/DictItemRepository.php
Normal file
19
app/repositories/DictItemRepository.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace app\repositories;
|
||||
|
||||
use app\common\base\BaseRepository;
|
||||
use app\models\DictItem;
|
||||
|
||||
/**
|
||||
* 字典项仓储
|
||||
*/
|
||||
class DictItemRepository extends BaseRepository
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new DictItem());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
54
app/repositories/MenuRepository.php
Normal file
54
app/repositories/MenuRepository.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace app\repositories;
|
||||
|
||||
use app\common\base\BaseRepository;
|
||||
use app\models\Menu;
|
||||
|
||||
/**
|
||||
* 菜单 / 权限仓储
|
||||
*/
|
||||
class MenuRepository extends BaseRepository
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new Menu());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有启用的菜单(仅目录和菜单类型,排除按钮)
|
||||
*/
|
||||
public function getAllEnabledMenus(): array
|
||||
{
|
||||
return $this->model
|
||||
->newQuery()
|
||||
->whereIn('type', [1, 2]) // 1目录 2菜单,排除3按钮
|
||||
->where('status', 1) // 只获取启用的菜单
|
||||
->orderBy('sort', 'asc')
|
||||
->orderBy('id', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单ID列表获取启用的菜单(仅目录和菜单类型,排除按钮)
|
||||
*/
|
||||
public function getMenusByIds(array $menuIds): array
|
||||
{
|
||||
if (empty($menuIds)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->model
|
||||
->newQuery()
|
||||
->whereIn('id', $menuIds)
|
||||
->whereIn('type', [1, 2]) // 1目录 2菜单,排除3按钮
|
||||
->where('status', 1) // 只获取启用的菜单
|
||||
->orderBy('sort', 'asc')
|
||||
->orderBy('id', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
app/repositories/RoleRepository.php
Normal file
19
app/repositories/RoleRepository.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace app\repositories;
|
||||
|
||||
use app\common\base\BaseRepository;
|
||||
use app\models\Role;
|
||||
|
||||
/**
|
||||
* 角色仓储
|
||||
*/
|
||||
class RoleRepository extends BaseRepository
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new Role());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use support\validation\ValidationException;
|
||||
use app\exceptions\ValidationException;
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
BIN
doc/img/1.png
Normal file
BIN
doc/img/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
BIN
doc/img/2.png
Normal file
BIN
doc/img/2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
14
test.php
Normal file
14
test.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* 测试脚本
|
||||
*/
|
||||
|
||||
// 加载自动加载文件和引导文件
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
require_once __DIR__ . '/support/bootstrap.php';
|
||||
|
||||
use app\services\SystemSettingService;
|
||||
|
||||
$systemSettingService = container_get(SystemSettingService::class);
|
||||
$tabs = $systemSettingService->getTabs();
|
||||
echo json_encode($tabs, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
Reference in New Issue
Block a user