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