From f894334057ce447fe0da3856807f0c394b28f043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=98=E4=B9=89=E6=96=8C?= <304526003@qq.com> Date: Thu, 21 May 2026 19:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=94=B9=E6=88=90=20elemen?= =?UTF-8?q?t-plus=20=E9=A3=8E=E6=A0=BC=20=E6=96=B0=E5=A2=9E=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=97=B6=E5=8F=AF=E9=85=8D=E7=BD=AE=E8=A1=A8=E5=89=8D?= =?UTF-8?q?=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/logic/system/SystemLoginLogLogic.php | 8 +- .../app/model/system/SystemAttachment.php | 4 +- .../app/model/system/SystemCategory.php | 4 +- .../app/model/system/SystemConfig.php | 4 +- .../app/model/system/SystemConfigGroup.php | 4 +- .../eloquent/app/model/system/SystemDept.php | 4 +- .../app/model/system/SystemDictData.php | 4 +- .../app/model/system/SystemDictType.php | 4 +- .../app/model/system/SystemLoginLog.php | 4 +- .../eloquent/app/model/system/SystemMail.php | 4 +- .../eloquent/app/model/system/SystemMenu.php | 4 +- .../app/model/system/SystemOperLog.php | 4 +- .../eloquent/app/model/system/SystemPost.php | 4 +- .../eloquent/app/model/system/SystemRole.php | 4 +- .../app/model/system/SystemRoleDept.php | 4 +- .../app/model/system/SystemRoleMenu.php | 4 +- .../eloquent/app/model/system/SystemUser.php | 4 +- .../app/model/system/SystemUserPost.php | 4 +- .../app/model/system/SystemUserRole.php | 4 +- src/orm/eloquent/app/model/tool/Crontab.php | 4 +- .../eloquent/app/model/tool/CrontabLog.php | 4 +- .../app/model/tool/GenerateColumns.php | 2 +- .../app/model/tool/GenerateTables.php | 2 +- .../app/logic/system/SystemLoginLogLogic.php | 8 +- .../app/logic/system/SystemRoleLogic.php | 2 +- .../app/model/system/SystemAttachment.php | 4 +- .../think/app/model/system/SystemCategory.php | 4 +- .../think/app/model/system/SystemConfig.php | 4 +- .../app/model/system/SystemConfigGroup.php | 4 +- src/orm/think/app/model/system/SystemDept.php | 4 +- .../think/app/model/system/SystemDictData.php | 4 +- .../think/app/model/system/SystemDictType.php | 4 +- .../think/app/model/system/SystemLoginLog.php | 4 +- src/orm/think/app/model/system/SystemMail.php | 4 +- src/orm/think/app/model/system/SystemMenu.php | 4 +- .../think/app/model/system/SystemOperLog.php | 4 +- src/orm/think/app/model/system/SystemPost.php | 4 +- src/orm/think/app/model/system/SystemRole.php | 4 +- .../think/app/model/system/SystemRoleDept.php | 4 +- .../think/app/model/system/SystemRoleMenu.php | 4 +- src/orm/think/app/model/system/SystemUser.php | 4 +- .../think/app/model/system/SystemUserPost.php | 4 +- .../think/app/model/system/SystemUserRole.php | 4 +- src/orm/think/app/model/tool/Crontab.php | 4 +- src/orm/think/app/model/tool/CrontabLog.php | 4 +- .../think/app/model/tool/GenerateColumns.php | 2 +- .../think/app/model/tool/GenerateTables.php | 2 +- .../app/controller/InstallController.php | 19 +- .../app/logic/system/SystemLoginLogLogic.php | 8 +- .../app/logic/system/SystemRoleLogic.php | 2 +- .../app/model/system/SystemAttachment.php | 4 +- .../app/model/system/SystemCategory.php | 4 +- .../app/model/system/SystemConfig.php | 4 +- .../app/model/system/SystemConfigGroup.php | 4 +- .../saiadmin/app/model/system/SystemDept.php | 4 +- .../app/model/system/SystemDictData.php | 4 +- .../app/model/system/SystemDictType.php | 4 +- .../app/model/system/SystemLoginLog.php | 4 +- .../saiadmin/app/model/system/SystemMail.php | 4 +- .../saiadmin/app/model/system/SystemMenu.php | 4 +- .../app/model/system/SystemOperLog.php | 4 +- .../saiadmin/app/model/system/SystemPost.php | 4 +- .../saiadmin/app/model/system/SystemRole.php | 4 +- .../app/model/system/SystemRoleDept.php | 4 +- .../app/model/system/SystemRoleMenu.php | 4 +- .../saiadmin/app/model/system/SystemUser.php | 4 +- .../app/model/system/SystemUserPost.php | 4 +- .../app/model/system/SystemUserRole.php | 4 +- .../saiadmin/app/model/tool/Crontab.php | 4 +- .../saiadmin/app/model/tool/CrontabLog.php | 4 +- .../app/model/tool/GenerateColumns.php | 2 +- .../app/model/tool/GenerateTables.php | 2 +- .../saiadmin/app/view/install/error.html | 352 +++-- .../saiadmin/app/view/install/index.html | 1234 +++++------------ 74 files changed, 657 insertions(+), 1228 deletions(-) diff --git a/src/orm/eloquent/app/logic/system/SystemLoginLogLogic.php b/src/orm/eloquent/app/logic/system/SystemLoginLogLogic.php index be86e7b..a1b892c 100644 --- a/src/orm/eloquent/app/logic/system/SystemLoginLogLogic.php +++ b/src/orm/eloquent/app/logic/system/SystemLoginLogLogic.php @@ -30,6 +30,8 @@ public function __construct() */ public function loginChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT d.date AS login_date, @@ -40,7 +42,7 @@ public function loginChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) a ) d - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l ON DATE(l.login_time) = d.date GROUP BY d.date ORDER BY d.date ASC; @@ -58,6 +60,8 @@ public function loginChart(): array */ public function loginBarChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT -- 拼接成 YYYY-MM 格式,例如 2023-01 @@ -69,7 +73,7 @@ public function loginBarChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12) m - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l -- 关联条件:年份等于今年 且 月份等于生成的数字 ON YEAR(l.login_time) = YEAR(CURDATE()) AND MONTH(l.login_time) = m.month_num diff --git a/src/orm/eloquent/app/model/system/SystemAttachment.php b/src/orm/eloquent/app/model/system/SystemAttachment.php index cc41d37..283457f 100644 --- a/src/orm/eloquent/app/model/system/SystemAttachment.php +++ b/src/orm/eloquent/app/model/system/SystemAttachment.php @@ -11,7 +11,7 @@ /** * 附件模型 * - * sa_system_attachment 附件信息表 + * system_attachment 附件信息表 * * @property $id 主键 * @property $category_id 文件分类 @@ -39,7 +39,7 @@ class SystemAttachment extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_attachment'; + protected $table = 'system_attachment'; /** * 文件名搜索 diff --git a/src/orm/eloquent/app/model/system/SystemCategory.php b/src/orm/eloquent/app/model/system/SystemCategory.php index 72a8e4c..1923d99 100644 --- a/src/orm/eloquent/app/model/system/SystemCategory.php +++ b/src/orm/eloquent/app/model/system/SystemCategory.php @@ -11,7 +11,7 @@ /** * 附件分类模型 * - * sa_system_category 附件分类表 + * system_category 附件分类表 * * @property $id 分类ID * @property $parent_id 父id @@ -33,7 +33,7 @@ class SystemCategory extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_category'; + protected $table = 'system_category'; /** * 分类名称搜索 diff --git a/src/orm/eloquent/app/model/system/SystemConfig.php b/src/orm/eloquent/app/model/system/SystemConfig.php index d360295..8d4faa2 100644 --- a/src/orm/eloquent/app/model/system/SystemConfig.php +++ b/src/orm/eloquent/app/model/system/SystemConfig.php @@ -11,7 +11,7 @@ /** * 参数配置模型 * - * sa_system_config 参数配置信息表 + * system_config 参数配置信息表 * * @property $id 编号 * @property $group_id 组id @@ -35,7 +35,7 @@ class SystemConfig extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_config'; + protected $table = 'system_config'; protected function casts(): array { diff --git a/src/orm/eloquent/app/model/system/SystemConfigGroup.php b/src/orm/eloquent/app/model/system/SystemConfigGroup.php index 54ba81d..06563a8 100644 --- a/src/orm/eloquent/app/model/system/SystemConfigGroup.php +++ b/src/orm/eloquent/app/model/system/SystemConfigGroup.php @@ -11,7 +11,7 @@ /** * 参数配置分组模型 * - * sa_system_config_group 参数配置分组表 + * system_config_group 参数配置分组表 * * @property $id 主键 * @property $name 字典名称 @@ -30,7 +30,7 @@ class SystemConfigGroup extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_config_group'; + protected $table = 'system_config_group'; /** * 关联配置列表 diff --git a/src/orm/eloquent/app/model/system/SystemDept.php b/src/orm/eloquent/app/model/system/SystemDept.php index e610edc..6951902 100644 --- a/src/orm/eloquent/app/model/system/SystemDept.php +++ b/src/orm/eloquent/app/model/system/SystemDept.php @@ -11,7 +11,7 @@ /** * 部门模型 * - * sa_system_dept 部门表 + * system_dept 部门表 * * @property $id 编号 * @property $parent_id 父级ID,0为根节点 @@ -35,7 +35,7 @@ class SystemDept extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_dept'; + protected $table = 'system_dept'; /** * 权限范围 diff --git a/src/orm/eloquent/app/model/system/SystemDictData.php b/src/orm/eloquent/app/model/system/SystemDictData.php index 45bb587..2648a5e 100644 --- a/src/orm/eloquent/app/model/system/SystemDictData.php +++ b/src/orm/eloquent/app/model/system/SystemDictData.php @@ -11,7 +11,7 @@ /** * 字典数据模型 * - * sa_system_dict_data 字典数据表 + * system_dict_data 字典数据表 * * @property $id 主键 * @property $type_id 字典类型ID @@ -35,7 +35,7 @@ class SystemDictData extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_dict_data'; + protected $table = 'system_dict_data'; /** * 关键字搜索 diff --git a/src/orm/eloquent/app/model/system/SystemDictType.php b/src/orm/eloquent/app/model/system/SystemDictType.php index b17c493..c661e87 100644 --- a/src/orm/eloquent/app/model/system/SystemDictType.php +++ b/src/orm/eloquent/app/model/system/SystemDictType.php @@ -11,7 +11,7 @@ /** * 字典类型模型 * - * sa_system_dict_type 字典类型表 + * system_dict_type 字典类型表 * * @property $id 主键 * @property $name 字典名称 @@ -31,7 +31,7 @@ class SystemDictType extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_dict_type'; + protected $table = 'system_dict_type'; /** * 关联字典数据 diff --git a/src/orm/eloquent/app/model/system/SystemLoginLog.php b/src/orm/eloquent/app/model/system/SystemLoginLog.php index 86db947..0fe17fa 100644 --- a/src/orm/eloquent/app/model/system/SystemLoginLog.php +++ b/src/orm/eloquent/app/model/system/SystemLoginLog.php @@ -12,7 +12,7 @@ /** * 登录日志模型 * - * sa_system_login_log 登录日志表 + * system_login_log 登录日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,7 +37,7 @@ class SystemLoginLog extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_login_log'; + protected $table = 'system_login_log'; /** * 时间范围搜索 diff --git a/src/orm/eloquent/app/model/system/SystemMail.php b/src/orm/eloquent/app/model/system/SystemMail.php index 5674d75..e0247e1 100644 --- a/src/orm/eloquent/app/model/system/SystemMail.php +++ b/src/orm/eloquent/app/model/system/SystemMail.php @@ -11,7 +11,7 @@ /** * 邮件记录模型 * - * sa_system_mail 邮件记录 + * system_mail 邮件记录 * * @property $id 编号 * @property $gateway 网关 @@ -32,7 +32,7 @@ class SystemMail extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_mail'; + protected $table = 'system_mail'; /** * 发送人搜索 diff --git a/src/orm/eloquent/app/model/system/SystemMenu.php b/src/orm/eloquent/app/model/system/SystemMenu.php index cd239a8..2de31b0 100644 --- a/src/orm/eloquent/app/model/system/SystemMenu.php +++ b/src/orm/eloquent/app/model/system/SystemMenu.php @@ -11,7 +11,7 @@ /** * 菜单模型 * - * sa_system_menu 菜单权限表 + * system_menu 菜单权限表 * * @property $id * @property $parent_id 父级ID @@ -42,7 +42,7 @@ class SystemMenu extends BaseModel { // 完整数据库表名称 - protected $table = 'sa_system_menu'; + protected $table = 'system_menu'; // 主键 protected $primaryKey = 'id'; diff --git a/src/orm/eloquent/app/model/system/SystemOperLog.php b/src/orm/eloquent/app/model/system/SystemOperLog.php index bd20c8d..c005fd8 100644 --- a/src/orm/eloquent/app/model/system/SystemOperLog.php +++ b/src/orm/eloquent/app/model/system/SystemOperLog.php @@ -12,7 +12,7 @@ /** * 操作日志模型 * - * sa_system_oper_log 操作日志表 + * system_oper_log 操作日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,6 +37,6 @@ class SystemOperLog extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_oper_log'; + protected $table = 'system_oper_log'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/system/SystemPost.php b/src/orm/eloquent/app/model/system/SystemPost.php index 4bdc8f6..14c196c 100644 --- a/src/orm/eloquent/app/model/system/SystemPost.php +++ b/src/orm/eloquent/app/model/system/SystemPost.php @@ -11,7 +11,7 @@ /** * 岗位模型 * - * sa_system_post 岗位信息表 + * system_post 岗位信息表 * * @property $id 主键 * @property $name 岗位名称 @@ -32,6 +32,6 @@ class SystemPost extends BaseModel */ protected $primaryKey = 'id'; - protected $table = 'sa_system_post'; + protected $table = 'system_post'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/system/SystemRole.php b/src/orm/eloquent/app/model/system/SystemRole.php index b8cc363..e10b928 100644 --- a/src/orm/eloquent/app/model/system/SystemRole.php +++ b/src/orm/eloquent/app/model/system/SystemRole.php @@ -11,7 +11,7 @@ /** * 角色模型 * - * sa_system_role 角色表 + * system_role 角色表 * * @property $id * @property $name 角色名称 @@ -39,7 +39,7 @@ class SystemRole extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_role'; + protected $table = 'system_role'; /** * 权限范围 diff --git a/src/orm/eloquent/app/model/system/SystemRoleDept.php b/src/orm/eloquent/app/model/system/SystemRoleDept.php index 5162538..9abd400 100644 --- a/src/orm/eloquent/app/model/system/SystemRoleDept.php +++ b/src/orm/eloquent/app/model/system/SystemRoleDept.php @@ -11,7 +11,7 @@ /** * 角色部门关联模型 * - * sa_system_role_dept 角色-自定义数据权限关联 + * system_role_dept 角色-自定义数据权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleDept extends Pivot { protected $primaryKey = 'id'; - protected $table = 'sa_system_role_dept'; + protected $table = 'system_role_dept'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/system/SystemRoleMenu.php b/src/orm/eloquent/app/model/system/SystemRoleMenu.php index 8a32270..b399d01 100644 --- a/src/orm/eloquent/app/model/system/SystemRoleMenu.php +++ b/src/orm/eloquent/app/model/system/SystemRoleMenu.php @@ -11,7 +11,7 @@ /** * 角色菜单关联模型 * - * sa_system_role_menu 角色权限关联 + * system_role_menu 角色权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleMenu extends Pivot { protected $primaryKey = 'id'; - protected $table = 'sa_system_role_menu'; + protected $table = 'system_role_menu'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/system/SystemUser.php b/src/orm/eloquent/app/model/system/SystemUser.php index 2ad97ba..859d785 100644 --- a/src/orm/eloquent/app/model/system/SystemUser.php +++ b/src/orm/eloquent/app/model/system/SystemUser.php @@ -11,7 +11,7 @@ /** * 用户信息模型 * - * sa_system_user 用户表 + * system_user 用户表 * * @property $id * @property $username 登录账号 @@ -47,7 +47,7 @@ class SystemUser extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_user'; + protected $table = 'system_user'; /** * 关键字搜索 diff --git a/src/orm/eloquent/app/model/system/SystemUserPost.php b/src/orm/eloquent/app/model/system/SystemUserPost.php index a96e4fa..48ee81b 100644 --- a/src/orm/eloquent/app/model/system/SystemUserPost.php +++ b/src/orm/eloquent/app/model/system/SystemUserPost.php @@ -11,7 +11,7 @@ /** * 用户岗位关联模型 * - * sa_system_user_post 用户与岗位关联表 + * system_user_post 用户与岗位关联表 * * @property $id 主键 * @property $user_id 用户主键 @@ -21,5 +21,5 @@ class SystemUserPost extends Pivot { protected $primaryKey = 'id'; - protected $table = 'sa_system_user_post'; + protected $table = 'system_user_post'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/system/SystemUserRole.php b/src/orm/eloquent/app/model/system/SystemUserRole.php index 226ad52..281b7b5 100644 --- a/src/orm/eloquent/app/model/system/SystemUserRole.php +++ b/src/orm/eloquent/app/model/system/SystemUserRole.php @@ -11,7 +11,7 @@ /** * 用户角色关联模型 * - * sa_system_user_role 用户角色关联 + * system_user_role 用户角色关联 * * @property $id * @property $user_id @@ -20,7 +20,7 @@ class SystemUserRole extends Pivot { protected $primaryKey = 'id'; - protected $table = 'sa_system_user_role'; + protected $table = 'system_user_role'; /** * 获取角色id diff --git a/src/orm/eloquent/app/model/tool/Crontab.php b/src/orm/eloquent/app/model/tool/Crontab.php index 34bb4b2..13800b8 100644 --- a/src/orm/eloquent/app/model/tool/Crontab.php +++ b/src/orm/eloquent/app/model/tool/Crontab.php @@ -11,7 +11,7 @@ /** * 定时任务模型 * - * sa_tool_crontab 定时任务信息表 + * tool_crontab 定时任务信息表 * * @property $id 主键 * @property $name 任务名称 @@ -35,6 +35,6 @@ class Crontab extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab'; + protected $table = 'tool_crontab'; } \ No newline at end of file diff --git a/src/orm/eloquent/app/model/tool/CrontabLog.php b/src/orm/eloquent/app/model/tool/CrontabLog.php index 2e00149..f0367e5 100644 --- a/src/orm/eloquent/app/model/tool/CrontabLog.php +++ b/src/orm/eloquent/app/model/tool/CrontabLog.php @@ -11,7 +11,7 @@ /** * 定时任务日志模型 * - * sa_tool_crontab_log 定时任务执行日志表 + * tool_crontab_log 定时任务执行日志表 * * @property $id 主键 * @property $crontab_id 任务ID @@ -31,7 +31,7 @@ class CrontabLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab_log'; + protected $table = 'tool_crontab_log'; protected $guarded = ['created_by', 'updated_by']; diff --git a/src/orm/eloquent/app/model/tool/GenerateColumns.php b/src/orm/eloquent/app/model/tool/GenerateColumns.php index c9d23ae..9e187e4 100644 --- a/src/orm/eloquent/app/model/tool/GenerateColumns.php +++ b/src/orm/eloquent/app/model/tool/GenerateColumns.php @@ -19,7 +19,7 @@ class GenerateColumns extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_columns'; + protected $table = 'tool_generate_columns'; protected $guarded = ['is_cover']; diff --git a/src/orm/eloquent/app/model/tool/GenerateTables.php b/src/orm/eloquent/app/model/tool/GenerateTables.php index 9757a11..ce397ad 100644 --- a/src/orm/eloquent/app/model/tool/GenerateTables.php +++ b/src/orm/eloquent/app/model/tool/GenerateTables.php @@ -19,6 +19,6 @@ class GenerateTables extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_tables'; + protected $table = 'tool_generate_tables'; } \ No newline at end of file diff --git a/src/orm/think/app/logic/system/SystemLoginLogLogic.php b/src/orm/think/app/logic/system/SystemLoginLogLogic.php index 4f7b227..a3379c5 100644 --- a/src/orm/think/app/logic/system/SystemLoginLogLogic.php +++ b/src/orm/think/app/logic/system/SystemLoginLogLogic.php @@ -30,6 +30,8 @@ public function __construct() */ public function loginChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT d.date AS login_date, @@ -40,7 +42,7 @@ public function loginChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) a ) d - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l ON DATE(l.login_time) = d.date GROUP BY d.date ORDER BY d.date ASC; @@ -58,6 +60,8 @@ public function loginChart(): array */ public function loginBarChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT -- 拼接成 YYYY-MM 格式,例如 2023-01 @@ -69,7 +73,7 @@ public function loginBarChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12) m - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l -- 关联条件:年份等于今年 且 月份等于生成的数字 ON YEAR(l.login_time) = YEAR(CURDATE()) AND MONTH(l.login_time) = m.month_num diff --git a/src/orm/think/app/logic/system/SystemRoleLogic.php b/src/orm/think/app/logic/system/SystemRoleLogic.php index c9429a0..2368f90 100644 --- a/src/orm/think/app/logic/system/SystemRoleLogic.php +++ b/src/orm/think/app/logic/system/SystemRoleLogic.php @@ -143,7 +143,7 @@ public function saveMenuPermission($id, $menu_ids): mixed $data = array_map(function ($menu_id) use ($id) { return ['menu_id' => $menu_id, 'role_id' => $id]; }, $menu_ids); - Db::name('sa_system_role_menu')->limit(100)->insertAll($data); + Db::table('system_role_menu')->limit(100)->insertAll($data); } $cache = config('plugin.saiadmin.saithink.button_cache'); $tag = $cache['role'] . $id; diff --git a/src/orm/think/app/model/system/SystemAttachment.php b/src/orm/think/app/model/system/SystemAttachment.php index 7d31696..612c61e 100644 --- a/src/orm/think/app/model/system/SystemAttachment.php +++ b/src/orm/think/app/model/system/SystemAttachment.php @@ -11,7 +11,7 @@ /** * 附件模型 * - * sa_system_attachment 附件信息表 + * system_attachment 附件信息表 * * @property $id 主键 * @property $category_id 文件分类 @@ -39,7 +39,7 @@ class SystemAttachment extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_attachment'; + protected $name = 'system_attachment'; /** * 原文件名搜索 diff --git a/src/orm/think/app/model/system/SystemCategory.php b/src/orm/think/app/model/system/SystemCategory.php index 005fcba..1352a53 100644 --- a/src/orm/think/app/model/system/SystemCategory.php +++ b/src/orm/think/app/model/system/SystemCategory.php @@ -11,7 +11,7 @@ /** * 附件分类模型 * - * sa_system_category 附件分类表 + * system_category 附件分类表 * * @property $id 分类ID * @property $parent_id 父id @@ -33,7 +33,7 @@ class SystemCategory extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_category'; + protected $name = 'system_category'; /** * 分类名称搜索 diff --git a/src/orm/think/app/model/system/SystemConfig.php b/src/orm/think/app/model/system/SystemConfig.php index 91b4178..fe961f2 100644 --- a/src/orm/think/app/model/system/SystemConfig.php +++ b/src/orm/think/app/model/system/SystemConfig.php @@ -11,7 +11,7 @@ /** * 参数配置模型 * - * sa_system_config 参数配置信息表 + * system_config 参数配置信息表 * * @property $id 编号 * @property $group_id 组id @@ -35,7 +35,7 @@ class SystemConfig extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_config'; + protected $name = 'system_config'; public function getConfigSelectDataAttr($value) { diff --git a/src/orm/think/app/model/system/SystemConfigGroup.php b/src/orm/think/app/model/system/SystemConfigGroup.php index 56e9964..90915dc 100644 --- a/src/orm/think/app/model/system/SystemConfigGroup.php +++ b/src/orm/think/app/model/system/SystemConfigGroup.php @@ -11,7 +11,7 @@ /** * 参数配置分组模型 * - * sa_system_config_group 参数配置分组表 + * system_config_group 参数配置分组表 * * @property $id 主键 * @property $name 字典名称 @@ -30,7 +30,7 @@ class SystemConfigGroup extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_config_group'; + protected $name = 'system_config_group'; /** * 关联配置列表 diff --git a/src/orm/think/app/model/system/SystemDept.php b/src/orm/think/app/model/system/SystemDept.php index 99fc923..e1afb7d 100644 --- a/src/orm/think/app/model/system/SystemDept.php +++ b/src/orm/think/app/model/system/SystemDept.php @@ -11,7 +11,7 @@ /** * 部门模型 * - * sa_system_dept 部门表 + * system_dept 部门表 * * @property $id 编号 * @property $parent_id 父级ID,0为根节点 @@ -35,7 +35,7 @@ class SystemDept extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dept'; + protected $name = 'system_dept'; /** * 权限范围 diff --git a/src/orm/think/app/model/system/SystemDictData.php b/src/orm/think/app/model/system/SystemDictData.php index 27f66ad..ea67d62 100644 --- a/src/orm/think/app/model/system/SystemDictData.php +++ b/src/orm/think/app/model/system/SystemDictData.php @@ -11,7 +11,7 @@ /** * 字典数据模型 * - * sa_system_dict_data 字典数据表 + * system_dict_data 字典数据表 * * @property $id 主键 * @property $type_id 字典类型ID @@ -35,7 +35,7 @@ class SystemDictData extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dict_data'; + protected $name = 'system_dict_data'; /** * 关键字搜索 diff --git a/src/orm/think/app/model/system/SystemDictType.php b/src/orm/think/app/model/system/SystemDictType.php index b7990ab..2680eb0 100644 --- a/src/orm/think/app/model/system/SystemDictType.php +++ b/src/orm/think/app/model/system/SystemDictType.php @@ -11,7 +11,7 @@ /** * 字典类型模型 * - * sa_system_dict_type 字典类型表 + * system_dict_type 字典类型表 * * @property $id 主键 * @property $name 字典名称 @@ -31,7 +31,7 @@ class SystemDictType extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dict_type'; + protected $name = 'system_dict_type'; /** * 关联字典数据 diff --git a/src/orm/think/app/model/system/SystemLoginLog.php b/src/orm/think/app/model/system/SystemLoginLog.php index 1aaba87..39f48af 100644 --- a/src/orm/think/app/model/system/SystemLoginLog.php +++ b/src/orm/think/app/model/system/SystemLoginLog.php @@ -12,7 +12,7 @@ /** * 登录日志模型 * - * sa_system_login_log 登录日志表 + * system_login_log 登录日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,7 +37,7 @@ class SystemLoginLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_login_log'; + protected $name = 'system_login_log'; /** * 时间范围搜索 diff --git a/src/orm/think/app/model/system/SystemMail.php b/src/orm/think/app/model/system/SystemMail.php index 367c2c1..7403a6d 100644 --- a/src/orm/think/app/model/system/SystemMail.php +++ b/src/orm/think/app/model/system/SystemMail.php @@ -11,7 +11,7 @@ /** * 邮件记录模型 * - * sa_system_mail 邮件记录 + * system_mail 邮件记录 * * @property $id 编号 * @property $gateway 网关 @@ -32,7 +32,7 @@ class SystemMail extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_mail'; + protected $name = 'system_mail'; /** * 发送人搜索 diff --git a/src/orm/think/app/model/system/SystemMenu.php b/src/orm/think/app/model/system/SystemMenu.php index e26261b..5cff502 100644 --- a/src/orm/think/app/model/system/SystemMenu.php +++ b/src/orm/think/app/model/system/SystemMenu.php @@ -11,7 +11,7 @@ /** * 菜单模型 * - * sa_system_menu 菜单权限表 + * system_menu 菜单权限表 * * @property $id * @property $parent_id 父级ID @@ -42,7 +42,7 @@ class SystemMenu extends BaseModel { // 完整数据库表名称 - protected $table = 'sa_system_menu'; + protected $name = 'system_menu'; // 主键 protected $pk = 'id'; diff --git a/src/orm/think/app/model/system/SystemOperLog.php b/src/orm/think/app/model/system/SystemOperLog.php index 4c95df3..c9fdae3 100644 --- a/src/orm/think/app/model/system/SystemOperLog.php +++ b/src/orm/think/app/model/system/SystemOperLog.php @@ -12,7 +12,7 @@ /** * 操作日志模型 * - * sa_system_oper_log 操作日志表 + * system_oper_log 操作日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,6 +37,6 @@ class SystemOperLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_oper_log'; + protected $name = 'system_oper_log'; } \ No newline at end of file diff --git a/src/orm/think/app/model/system/SystemPost.php b/src/orm/think/app/model/system/SystemPost.php index 5f26cdc..c6bc174 100644 --- a/src/orm/think/app/model/system/SystemPost.php +++ b/src/orm/think/app/model/system/SystemPost.php @@ -11,7 +11,7 @@ /** * 岗位模型 * - * sa_system_post 岗位信息表 + * system_post 岗位信息表 * * @property $id 主键 * @property $name 岗位名称 @@ -32,6 +32,6 @@ class SystemPost extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_post'; + protected $name = 'system_post'; } \ No newline at end of file diff --git a/src/orm/think/app/model/system/SystemRole.php b/src/orm/think/app/model/system/SystemRole.php index f5ac328..8aed24f 100644 --- a/src/orm/think/app/model/system/SystemRole.php +++ b/src/orm/think/app/model/system/SystemRole.php @@ -11,7 +11,7 @@ /** * 角色模型 * - * sa_system_role 角色表 + * system_role 角色表 * * @property $id * @property $name 角色名称 @@ -39,7 +39,7 @@ class SystemRole extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_role'; + protected $name = 'system_role'; /** * 权限范围 diff --git a/src/orm/think/app/model/system/SystemRoleDept.php b/src/orm/think/app/model/system/SystemRoleDept.php index e6590d5..9fd2188 100644 --- a/src/orm/think/app/model/system/SystemRoleDept.php +++ b/src/orm/think/app/model/system/SystemRoleDept.php @@ -11,7 +11,7 @@ /** * 角色部门关联模型 * - * sa_system_role_dept 角色-自定义数据权限关联 + * system_role_dept 角色-自定义数据权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleDept extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_role_dept'; + protected $name = 'system_role_dept'; } \ No newline at end of file diff --git a/src/orm/think/app/model/system/SystemRoleMenu.php b/src/orm/think/app/model/system/SystemRoleMenu.php index 10c16bf..98ebaaf 100644 --- a/src/orm/think/app/model/system/SystemRoleMenu.php +++ b/src/orm/think/app/model/system/SystemRoleMenu.php @@ -11,7 +11,7 @@ /** * 角色菜单关联模型 * - * sa_system_role_menu 角色权限关联 + * system_role_menu 角色权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleMenu extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_role_menu'; + protected $name = 'system_role_menu'; } \ No newline at end of file diff --git a/src/orm/think/app/model/system/SystemUser.php b/src/orm/think/app/model/system/SystemUser.php index 44475f9..8679fda 100644 --- a/src/orm/think/app/model/system/SystemUser.php +++ b/src/orm/think/app/model/system/SystemUser.php @@ -11,7 +11,7 @@ /** * 用户信息模型 * - * sa_system_user 用户表 + * system_user 用户表 * * @property $id * @property $username 登录账号 @@ -47,7 +47,7 @@ class SystemUser extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_user'; + protected $name = 'system_user'; public function searchKeywordAttr($query, $value) { diff --git a/src/orm/think/app/model/system/SystemUserPost.php b/src/orm/think/app/model/system/SystemUserPost.php index 0866ef3..de2eab3 100644 --- a/src/orm/think/app/model/system/SystemUserPost.php +++ b/src/orm/think/app/model/system/SystemUserPost.php @@ -11,7 +11,7 @@ /** * 用户岗位关联模型 * - * sa_system_user_post 用户与岗位关联表 + * system_user_post 用户与岗位关联表 * * @property $id 主键 * @property $user_id 用户主键 @@ -21,5 +21,5 @@ class SystemUserPost extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_user_post'; + protected $name = 'system_user_post'; } \ No newline at end of file diff --git a/src/orm/think/app/model/system/SystemUserRole.php b/src/orm/think/app/model/system/SystemUserRole.php index d88febe..14f1734 100644 --- a/src/orm/think/app/model/system/SystemUserRole.php +++ b/src/orm/think/app/model/system/SystemUserRole.php @@ -11,7 +11,7 @@ /** * 用户角色关联模型 * - * sa_system_user_role 用户角色关联 + * system_user_role 用户角色关联 * * @property $id * @property $user_id @@ -21,7 +21,7 @@ class SystemUserRole extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_user_role'; + protected $name = 'system_user_role'; /** * 获取角色id diff --git a/src/orm/think/app/model/tool/Crontab.php b/src/orm/think/app/model/tool/Crontab.php index 4adba78..da26435 100644 --- a/src/orm/think/app/model/tool/Crontab.php +++ b/src/orm/think/app/model/tool/Crontab.php @@ -11,7 +11,7 @@ /** * 定时任务模型 * - * sa_tool_crontab 定时任务信息表 + * tool_crontab 定时任务信息表 * * @property $id 主键 * @property $name 任务名称 @@ -35,6 +35,6 @@ class Crontab extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab'; + protected $name = 'tool_crontab'; } \ No newline at end of file diff --git a/src/orm/think/app/model/tool/CrontabLog.php b/src/orm/think/app/model/tool/CrontabLog.php index 22b91b3..2c5dd84 100644 --- a/src/orm/think/app/model/tool/CrontabLog.php +++ b/src/orm/think/app/model/tool/CrontabLog.php @@ -11,7 +11,7 @@ /** * 定时任务日志模型 * - * sa_tool_crontab_log 定时任务执行日志表 + * tool_crontab_log 定时任务执行日志表 * * @property $id 主键 * @property $crontab_id 任务ID @@ -31,6 +31,6 @@ class CrontabLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab_log'; + protected $name = 'tool_crontab_log'; } \ No newline at end of file diff --git a/src/orm/think/app/model/tool/GenerateColumns.php b/src/orm/think/app/model/tool/GenerateColumns.php index e824518..ec9b0b9 100644 --- a/src/orm/think/app/model/tool/GenerateColumns.php +++ b/src/orm/think/app/model/tool/GenerateColumns.php @@ -19,7 +19,7 @@ class GenerateColumns extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_columns'; + protected $name = 'tool_generate_columns'; public function getOptionsAttr($value) { diff --git a/src/orm/think/app/model/tool/GenerateTables.php b/src/orm/think/app/model/tool/GenerateTables.php index edb03b8..a4a64c0 100644 --- a/src/orm/think/app/model/tool/GenerateTables.php +++ b/src/orm/think/app/model/tool/GenerateTables.php @@ -19,7 +19,7 @@ class GenerateTables extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_tables'; + protected $name = 'tool_generate_tables'; public function getOptionsAttr($value) { diff --git a/src/plugin/saiadmin/app/controller/InstallController.php b/src/plugin/saiadmin/app/controller/InstallController.php index 5475221..8a4a363 100644 --- a/src/plugin/saiadmin/app/controller/InstallController.php +++ b/src/plugin/saiadmin/app/controller/InstallController.php @@ -6,10 +6,7 @@ // +---------------------------------------------------------------------- namespace plugin\saiadmin\app\controller; -use Throwable; use support\Request; -use support\Response; -use plugin\saiadmin\exception\ApiException; use plugin\saiadmin\basic\OpenController; /** @@ -71,6 +68,7 @@ public function install(Request $request) $database = $request->post('database'); $host = $request->post('host'); $port = (int) $request->post('port') ?: 3306; + $prefix = $request->post('prefix', ''); $dataType = $request->post('dataType', 'demo'); try { @@ -95,7 +93,9 @@ public function install(Request $request) $db->exec("use `$database`"); - $smt = $db->query("show tables like 'sa_system_menu';"); + // 检查表是否存在时,使用自定义前缀 + $checkTable = $prefix ? $prefix . 'system_menu' : 'sa_system_menu'; + $smt = $db->query("show tables like '$checkTable';"); $tables = $smt->fetchAll(); if (count($tables) > 0) { return $this->fail('数据库已经安装,请勿重复安装'); @@ -113,6 +113,11 @@ public function install(Request $request) $sql_query = file_get_contents($sql_file); + // 如果传了前缀,替换 SQL 文件中的 sa_ 为自定义前缀 + if (!empty($prefix)) { + $sql_query = str_replace('sa_', $prefix, $sql_query); + } + $db->exec($sql_query); $this->generateConfig(); @@ -125,7 +130,7 @@ public function install(Request $request) DB_NAME = $database DB_USER = $user DB_PASSWORD = $password -DB_PREFIX = +DB_PREFIX = $prefix # 缓存方式 CACHE_MODE = file @@ -353,8 +358,8 @@ protected function getPdo($host, $username, $password, $port, $database = null): $dsn .= "dbname=$database"; } $params = [ - \PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8mb4", - \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, + \PDO\Mysql::ATTR_INIT_COMMAND => "set names utf8mb4", + \PDO\Mysql::ATTR_USE_BUFFERED_QUERY => true, \PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_TIMEOUT => 5, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, diff --git a/src/plugin/saiadmin/app/logic/system/SystemLoginLogLogic.php b/src/plugin/saiadmin/app/logic/system/SystemLoginLogLogic.php index 4f7b227..a3379c5 100644 --- a/src/plugin/saiadmin/app/logic/system/SystemLoginLogLogic.php +++ b/src/plugin/saiadmin/app/logic/system/SystemLoginLogLogic.php @@ -30,6 +30,8 @@ public function __construct() */ public function loginChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT d.date AS login_date, @@ -40,7 +42,7 @@ public function loginChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) a ) d - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l ON DATE(l.login_time) = d.date GROUP BY d.date ORDER BY d.date ASC; @@ -58,6 +60,8 @@ public function loginChart(): array */ public function loginBarChart(): array { + $prefix = config('database.connections.mysql.prefix'); + $sql = " SELECT -- 拼接成 YYYY-MM 格式,例如 2023-01 @@ -69,7 +73,7 @@ public function loginBarChart(): array UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12) m - LEFT JOIN sa_system_login_log l + LEFT JOIN {$prefix}system_login_log l -- 关联条件:年份等于今年 且 月份等于生成的数字 ON YEAR(l.login_time) = YEAR(CURDATE()) AND MONTH(l.login_time) = m.month_num diff --git a/src/plugin/saiadmin/app/logic/system/SystemRoleLogic.php b/src/plugin/saiadmin/app/logic/system/SystemRoleLogic.php index c9429a0..2368f90 100644 --- a/src/plugin/saiadmin/app/logic/system/SystemRoleLogic.php +++ b/src/plugin/saiadmin/app/logic/system/SystemRoleLogic.php @@ -143,7 +143,7 @@ public function saveMenuPermission($id, $menu_ids): mixed $data = array_map(function ($menu_id) use ($id) { return ['menu_id' => $menu_id, 'role_id' => $id]; }, $menu_ids); - Db::name('sa_system_role_menu')->limit(100)->insertAll($data); + Db::table('system_role_menu')->limit(100)->insertAll($data); } $cache = config('plugin.saiadmin.saithink.button_cache'); $tag = $cache['role'] . $id; diff --git a/src/plugin/saiadmin/app/model/system/SystemAttachment.php b/src/plugin/saiadmin/app/model/system/SystemAttachment.php index 7d31696..612c61e 100644 --- a/src/plugin/saiadmin/app/model/system/SystemAttachment.php +++ b/src/plugin/saiadmin/app/model/system/SystemAttachment.php @@ -11,7 +11,7 @@ /** * 附件模型 * - * sa_system_attachment 附件信息表 + * system_attachment 附件信息表 * * @property $id 主键 * @property $category_id 文件分类 @@ -39,7 +39,7 @@ class SystemAttachment extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_attachment'; + protected $name = 'system_attachment'; /** * 原文件名搜索 diff --git a/src/plugin/saiadmin/app/model/system/SystemCategory.php b/src/plugin/saiadmin/app/model/system/SystemCategory.php index 005fcba..1352a53 100644 --- a/src/plugin/saiadmin/app/model/system/SystemCategory.php +++ b/src/plugin/saiadmin/app/model/system/SystemCategory.php @@ -11,7 +11,7 @@ /** * 附件分类模型 * - * sa_system_category 附件分类表 + * system_category 附件分类表 * * @property $id 分类ID * @property $parent_id 父id @@ -33,7 +33,7 @@ class SystemCategory extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_category'; + protected $name = 'system_category'; /** * 分类名称搜索 diff --git a/src/plugin/saiadmin/app/model/system/SystemConfig.php b/src/plugin/saiadmin/app/model/system/SystemConfig.php index 91b4178..fe961f2 100644 --- a/src/plugin/saiadmin/app/model/system/SystemConfig.php +++ b/src/plugin/saiadmin/app/model/system/SystemConfig.php @@ -11,7 +11,7 @@ /** * 参数配置模型 * - * sa_system_config 参数配置信息表 + * system_config 参数配置信息表 * * @property $id 编号 * @property $group_id 组id @@ -35,7 +35,7 @@ class SystemConfig extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_config'; + protected $name = 'system_config'; public function getConfigSelectDataAttr($value) { diff --git a/src/plugin/saiadmin/app/model/system/SystemConfigGroup.php b/src/plugin/saiadmin/app/model/system/SystemConfigGroup.php index 56e9964..90915dc 100644 --- a/src/plugin/saiadmin/app/model/system/SystemConfigGroup.php +++ b/src/plugin/saiadmin/app/model/system/SystemConfigGroup.php @@ -11,7 +11,7 @@ /** * 参数配置分组模型 * - * sa_system_config_group 参数配置分组表 + * system_config_group 参数配置分组表 * * @property $id 主键 * @property $name 字典名称 @@ -30,7 +30,7 @@ class SystemConfigGroup extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_config_group'; + protected $name = 'system_config_group'; /** * 关联配置列表 diff --git a/src/plugin/saiadmin/app/model/system/SystemDept.php b/src/plugin/saiadmin/app/model/system/SystemDept.php index 99fc923..e1afb7d 100644 --- a/src/plugin/saiadmin/app/model/system/SystemDept.php +++ b/src/plugin/saiadmin/app/model/system/SystemDept.php @@ -11,7 +11,7 @@ /** * 部门模型 * - * sa_system_dept 部门表 + * system_dept 部门表 * * @property $id 编号 * @property $parent_id 父级ID,0为根节点 @@ -35,7 +35,7 @@ class SystemDept extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dept'; + protected $name = 'system_dept'; /** * 权限范围 diff --git a/src/plugin/saiadmin/app/model/system/SystemDictData.php b/src/plugin/saiadmin/app/model/system/SystemDictData.php index 27f66ad..ea67d62 100644 --- a/src/plugin/saiadmin/app/model/system/SystemDictData.php +++ b/src/plugin/saiadmin/app/model/system/SystemDictData.php @@ -11,7 +11,7 @@ /** * 字典数据模型 * - * sa_system_dict_data 字典数据表 + * system_dict_data 字典数据表 * * @property $id 主键 * @property $type_id 字典类型ID @@ -35,7 +35,7 @@ class SystemDictData extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dict_data'; + protected $name = 'system_dict_data'; /** * 关键字搜索 diff --git a/src/plugin/saiadmin/app/model/system/SystemDictType.php b/src/plugin/saiadmin/app/model/system/SystemDictType.php index b7990ab..2680eb0 100644 --- a/src/plugin/saiadmin/app/model/system/SystemDictType.php +++ b/src/plugin/saiadmin/app/model/system/SystemDictType.php @@ -11,7 +11,7 @@ /** * 字典类型模型 * - * sa_system_dict_type 字典类型表 + * system_dict_type 字典类型表 * * @property $id 主键 * @property $name 字典名称 @@ -31,7 +31,7 @@ class SystemDictType extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_dict_type'; + protected $name = 'system_dict_type'; /** * 关联字典数据 diff --git a/src/plugin/saiadmin/app/model/system/SystemLoginLog.php b/src/plugin/saiadmin/app/model/system/SystemLoginLog.php index 1aaba87..39f48af 100644 --- a/src/plugin/saiadmin/app/model/system/SystemLoginLog.php +++ b/src/plugin/saiadmin/app/model/system/SystemLoginLog.php @@ -12,7 +12,7 @@ /** * 登录日志模型 * - * sa_system_login_log 登录日志表 + * system_login_log 登录日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,7 +37,7 @@ class SystemLoginLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_login_log'; + protected $name = 'system_login_log'; /** * 时间范围搜索 diff --git a/src/plugin/saiadmin/app/model/system/SystemMail.php b/src/plugin/saiadmin/app/model/system/SystemMail.php index 367c2c1..7403a6d 100644 --- a/src/plugin/saiadmin/app/model/system/SystemMail.php +++ b/src/plugin/saiadmin/app/model/system/SystemMail.php @@ -11,7 +11,7 @@ /** * 邮件记录模型 * - * sa_system_mail 邮件记录 + * system_mail 邮件记录 * * @property $id 编号 * @property $gateway 网关 @@ -32,7 +32,7 @@ class SystemMail extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_mail'; + protected $name = 'system_mail'; /** * 发送人搜索 diff --git a/src/plugin/saiadmin/app/model/system/SystemMenu.php b/src/plugin/saiadmin/app/model/system/SystemMenu.php index e26261b..5cff502 100644 --- a/src/plugin/saiadmin/app/model/system/SystemMenu.php +++ b/src/plugin/saiadmin/app/model/system/SystemMenu.php @@ -11,7 +11,7 @@ /** * 菜单模型 * - * sa_system_menu 菜单权限表 + * system_menu 菜单权限表 * * @property $id * @property $parent_id 父级ID @@ -42,7 +42,7 @@ class SystemMenu extends BaseModel { // 完整数据库表名称 - protected $table = 'sa_system_menu'; + protected $name = 'system_menu'; // 主键 protected $pk = 'id'; diff --git a/src/plugin/saiadmin/app/model/system/SystemOperLog.php b/src/plugin/saiadmin/app/model/system/SystemOperLog.php index 4c95df3..c9fdae3 100644 --- a/src/plugin/saiadmin/app/model/system/SystemOperLog.php +++ b/src/plugin/saiadmin/app/model/system/SystemOperLog.php @@ -12,7 +12,7 @@ /** * 操作日志模型 * - * sa_system_oper_log 操作日志表 + * system_oper_log 操作日志表 * * @property $id 主键 * @property $username 用户名 @@ -37,6 +37,6 @@ class SystemOperLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_oper_log'; + protected $name = 'system_oper_log'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/system/SystemPost.php b/src/plugin/saiadmin/app/model/system/SystemPost.php index 5f26cdc..c6bc174 100644 --- a/src/plugin/saiadmin/app/model/system/SystemPost.php +++ b/src/plugin/saiadmin/app/model/system/SystemPost.php @@ -11,7 +11,7 @@ /** * 岗位模型 * - * sa_system_post 岗位信息表 + * system_post 岗位信息表 * * @property $id 主键 * @property $name 岗位名称 @@ -32,6 +32,6 @@ class SystemPost extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_system_post'; + protected $name = 'system_post'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/system/SystemRole.php b/src/plugin/saiadmin/app/model/system/SystemRole.php index f5ac328..8aed24f 100644 --- a/src/plugin/saiadmin/app/model/system/SystemRole.php +++ b/src/plugin/saiadmin/app/model/system/SystemRole.php @@ -11,7 +11,7 @@ /** * 角色模型 * - * sa_system_role 角色表 + * system_role 角色表 * * @property $id * @property $name 角色名称 @@ -39,7 +39,7 @@ class SystemRole extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_role'; + protected $name = 'system_role'; /** * 权限范围 diff --git a/src/plugin/saiadmin/app/model/system/SystemRoleDept.php b/src/plugin/saiadmin/app/model/system/SystemRoleDept.php index e6590d5..9fd2188 100644 --- a/src/plugin/saiadmin/app/model/system/SystemRoleDept.php +++ b/src/plugin/saiadmin/app/model/system/SystemRoleDept.php @@ -11,7 +11,7 @@ /** * 角色部门关联模型 * - * sa_system_role_dept 角色-自定义数据权限关联 + * system_role_dept 角色-自定义数据权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleDept extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_role_dept'; + protected $name = 'system_role_dept'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/system/SystemRoleMenu.php b/src/plugin/saiadmin/app/model/system/SystemRoleMenu.php index 10c16bf..98ebaaf 100644 --- a/src/plugin/saiadmin/app/model/system/SystemRoleMenu.php +++ b/src/plugin/saiadmin/app/model/system/SystemRoleMenu.php @@ -11,7 +11,7 @@ /** * 角色菜单关联模型 * - * sa_system_role_menu 角色权限关联 + * system_role_menu 角色权限关联 * * @property $id * @property $role_id @@ -21,5 +21,5 @@ class SystemRoleMenu extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_role_menu'; + protected $name = 'system_role_menu'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/system/SystemUser.php b/src/plugin/saiadmin/app/model/system/SystemUser.php index 44475f9..8679fda 100644 --- a/src/plugin/saiadmin/app/model/system/SystemUser.php +++ b/src/plugin/saiadmin/app/model/system/SystemUser.php @@ -11,7 +11,7 @@ /** * 用户信息模型 * - * sa_system_user 用户表 + * system_user 用户表 * * @property $id * @property $username 登录账号 @@ -47,7 +47,7 @@ class SystemUser extends BaseModel * 数据表完整名称 * @var string */ - protected $table = 'sa_system_user'; + protected $name = 'system_user'; public function searchKeywordAttr($query, $value) { diff --git a/src/plugin/saiadmin/app/model/system/SystemUserPost.php b/src/plugin/saiadmin/app/model/system/SystemUserPost.php index 0866ef3..de2eab3 100644 --- a/src/plugin/saiadmin/app/model/system/SystemUserPost.php +++ b/src/plugin/saiadmin/app/model/system/SystemUserPost.php @@ -11,7 +11,7 @@ /** * 用户岗位关联模型 * - * sa_system_user_post 用户与岗位关联表 + * system_user_post 用户与岗位关联表 * * @property $id 主键 * @property $user_id 用户主键 @@ -21,5 +21,5 @@ class SystemUserPost extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_user_post'; + protected $name = 'system_user_post'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/system/SystemUserRole.php b/src/plugin/saiadmin/app/model/system/SystemUserRole.php index d88febe..14f1734 100644 --- a/src/plugin/saiadmin/app/model/system/SystemUserRole.php +++ b/src/plugin/saiadmin/app/model/system/SystemUserRole.php @@ -11,7 +11,7 @@ /** * 用户角色关联模型 * - * sa_system_user_role 用户角色关联 + * system_user_role 用户角色关联 * * @property $id * @property $user_id @@ -21,7 +21,7 @@ class SystemUserRole extends Pivot { protected $pk = 'id'; - protected $table = 'sa_system_user_role'; + protected $name = 'system_user_role'; /** * 获取角色id diff --git a/src/plugin/saiadmin/app/model/tool/Crontab.php b/src/plugin/saiadmin/app/model/tool/Crontab.php index 4adba78..da26435 100644 --- a/src/plugin/saiadmin/app/model/tool/Crontab.php +++ b/src/plugin/saiadmin/app/model/tool/Crontab.php @@ -11,7 +11,7 @@ /** * 定时任务模型 * - * sa_tool_crontab 定时任务信息表 + * tool_crontab 定时任务信息表 * * @property $id 主键 * @property $name 任务名称 @@ -35,6 +35,6 @@ class Crontab extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab'; + protected $name = 'tool_crontab'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/tool/CrontabLog.php b/src/plugin/saiadmin/app/model/tool/CrontabLog.php index 22b91b3..2c5dd84 100644 --- a/src/plugin/saiadmin/app/model/tool/CrontabLog.php +++ b/src/plugin/saiadmin/app/model/tool/CrontabLog.php @@ -11,7 +11,7 @@ /** * 定时任务日志模型 * - * sa_tool_crontab_log 定时任务执行日志表 + * tool_crontab_log 定时任务执行日志表 * * @property $id 主键 * @property $crontab_id 任务ID @@ -31,6 +31,6 @@ class CrontabLog extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_crontab_log'; + protected $name = 'tool_crontab_log'; } \ No newline at end of file diff --git a/src/plugin/saiadmin/app/model/tool/GenerateColumns.php b/src/plugin/saiadmin/app/model/tool/GenerateColumns.php index e824518..ec9b0b9 100644 --- a/src/plugin/saiadmin/app/model/tool/GenerateColumns.php +++ b/src/plugin/saiadmin/app/model/tool/GenerateColumns.php @@ -19,7 +19,7 @@ class GenerateColumns extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_columns'; + protected $name = 'tool_generate_columns'; public function getOptionsAttr($value) { diff --git a/src/plugin/saiadmin/app/model/tool/GenerateTables.php b/src/plugin/saiadmin/app/model/tool/GenerateTables.php index edb03b8..a4a64c0 100644 --- a/src/plugin/saiadmin/app/model/tool/GenerateTables.php +++ b/src/plugin/saiadmin/app/model/tool/GenerateTables.php @@ -19,7 +19,7 @@ class GenerateTables extends BaseModel */ protected $pk = 'id'; - protected $table = 'sa_tool_generate_tables'; + protected $name = 'tool_generate_tables'; public function getOptionsAttr($value) { diff --git a/src/plugin/saiadmin/app/view/install/error.html b/src/plugin/saiadmin/app/view/install/error.html index b93f1b4..7897387 100644 --- a/src/plugin/saiadmin/app/view/install/error.html +++ b/src/plugin/saiadmin/app/view/install/error.html @@ -4,250 +4,236 @@ 安装错误 - + + + + - -
-
- +
+ +
+ Logo +

【{{app}}-{{version}}】安装配置向导

-

【{{app}}-{{version}}】安装配置向导

-
-
-
-
+ +
+
- - - - +

安装失败

-

错误提示:{{error}}

- 重新安装 +

很抱歉,安装过程中遇到了问题,请检查错误信息后重试。

+ +
+
+ + 错误详情 +
+
{{error}}
+
+ +
+ +   重新安装 + + +   返回首页 + +
+ + + + + + + + + diff --git a/src/plugin/saiadmin/app/view/install/index.html b/src/plugin/saiadmin/app/view/install/index.html index 4522dcf..8ae3df3 100644 --- a/src/plugin/saiadmin/app/view/install/index.html +++ b/src/plugin/saiadmin/app/view/install/index.html @@ -4,26 +4,13 @@ 应用安装向导 - - + + - -
- -
-
- Logo -
+
+ +
+ Logo

【{{app}}-{{version}}】安装配置向导

- -
-
- -
-
-
-
-
-
-
- -
-
数据库配置
-
-
-
- -
-
执行安装
-
-
-
- -
-
安装完成
-
-
-
- - -
- -
-

数据库配置

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
- -
-
-
-
-
-
- -
- -
- -
-
-
-
-
-
- -
- -
- -
-
-
-
-
-
- -
- -
- -
-
-
-
-
-
- -
- -
- -
-
-
-
-
-
- -
-
+ +
+ {{currentStep}} + + + + + + + + +
+

数据库配置

+ + + + + + 附带演示数据 + 纯净数据 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 下一步 +
+
+
- -
-

执行安装

-
-
+ +
+

执行安装

+ +
+
+
+
-
-
-
- -
-
-
准备开始安装...
-
刚刚
-
-
+
+
[[ log.text ]]
+
[[ log.time ]]
+
+ 暂无日志 +
+
+
- -
-
-
- -
-

安装成功

-

恭喜!已成功安装系统,请重启webman,启动前端项目进行访问。

- -
+ +
+
+
+
+

安装成功

+

恭喜!已成功安装系统,请重启webman,启动前端项目进行访问。

+ + 进入管理后台 +
- - + + + + + + + + +