Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/orm/eloquent/app/logic/system/SystemLoginLogLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function __construct()
*/
public function loginChart(): array
{
$prefix = config('database.connections.mysql.prefix');

$sql = "
SELECT
d.date AS login_date,
Expand All @@ -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;
Expand All @@ -58,6 +60,8 @@ public function loginChart(): array
*/
public function loginBarChart(): array
{
$prefix = config('database.connections.mysql.prefix');

$sql = "
SELECT
-- 拼接成 YYYY-MM 格式,例如 2023-01
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 附件模型
*
* sa_system_attachment 附件信息表
* system_attachment 附件信息表
*
* @property $id 主键
* @property $category_id 文件分类
Expand Down Expand Up @@ -39,7 +39,7 @@ class SystemAttachment extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_attachment';
protected $table = 'system_attachment';

/**
* 文件名搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 附件分类模型
*
* sa_system_category 附件分类表
* system_category 附件分类表
*
* @property $id 分类ID
* @property $parent_id 父id
Expand All @@ -33,7 +33,7 @@ class SystemCategory extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_category';
protected $table = 'system_category';

/**
* 分类名称搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 参数配置模型
*
* sa_system_config 参数配置信息表
* system_config 参数配置信息表
*
* @property $id 编号
* @property $group_id 组id
Expand All @@ -35,7 +35,7 @@ class SystemConfig extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_config';
protected $table = 'system_config';

protected function casts(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemConfigGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 参数配置分组模型
*
* sa_system_config_group 参数配置分组表
* system_config_group 参数配置分组表
*
* @property $id 主键
* @property $name 字典名称
Expand All @@ -30,7 +30,7 @@ class SystemConfigGroup extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_config_group';
protected $table = 'system_config_group';

/**
* 关联配置列表
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemDept.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 部门模型
*
* sa_system_dept 部门表
* system_dept 部门表
*
* @property $id 编号
* @property $parent_id 父级ID,0为根节点
Expand All @@ -35,7 +35,7 @@ class SystemDept extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_dept';
protected $table = 'system_dept';

/**
* 权限范围
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemDictData.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 字典数据模型
*
* sa_system_dict_data 字典数据表
* system_dict_data 字典数据表
*
* @property $id 主键
* @property $type_id 字典类型ID
Expand All @@ -35,7 +35,7 @@ class SystemDictData extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_dict_data';
protected $table = 'system_dict_data';

/**
* 关键字搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemDictType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 字典类型模型
*
* sa_system_dict_type 字典类型表
* system_dict_type 字典类型表
*
* @property $id 主键
* @property $name 字典名称
Expand All @@ -31,7 +31,7 @@ class SystemDictType extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_dict_type';
protected $table = 'system_dict_type';

/**
* 关联字典数据
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemLoginLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* 登录日志模型
*
* sa_system_login_log 登录日志表
* system_login_log 登录日志表
*
* @property $id 主键
* @property $username 用户名
Expand All @@ -37,7 +37,7 @@ class SystemLoginLog extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_login_log';
protected $table = 'system_login_log';

/**
* 时间范围搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 邮件记录模型
*
* sa_system_mail 邮件记录
* system_mail 邮件记录
*
* @property $id 编号
* @property $gateway 网关
Expand All @@ -32,7 +32,7 @@ class SystemMail extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_mail';
protected $table = 'system_mail';

/**
* 发送人搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 菜单模型
*
* sa_system_menu 菜单权限表
* system_menu 菜单权限表
*
* @property $id
* @property $parent_id 父级ID
Expand Down Expand Up @@ -42,7 +42,7 @@
class SystemMenu extends BaseModel
{
// 完整数据库表名称
protected $table = 'sa_system_menu';
protected $table = 'system_menu';
// 主键
protected $primaryKey = 'id';

Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemOperLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* 操作日志模型
*
* sa_system_oper_log 操作日志表
* system_oper_log 操作日志表
*
* @property $id 主键
* @property $username 用户名
Expand All @@ -37,6 +37,6 @@ class SystemOperLog extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_oper_log';
protected $table = 'system_oper_log';

}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 岗位模型
*
* sa_system_post 岗位信息表
* system_post 岗位信息表
*
* @property $id 主键
* @property $name 岗位名称
Expand All @@ -32,6 +32,6 @@ class SystemPost extends BaseModel
*/
protected $primaryKey = 'id';

protected $table = 'sa_system_post';
protected $table = 'system_post';

}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 角色模型
*
* sa_system_role 角色表
* system_role 角色表
*
* @property $id
* @property $name 角色名称
Expand Down Expand Up @@ -39,7 +39,7 @@ class SystemRole extends BaseModel
* 数据表完整名称
* @var string
*/
protected $table = 'sa_system_role';
protected $table = 'system_role';

/**
* 权限范围
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemRoleDept.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 角色部门关联模型
*
* sa_system_role_dept 角色-自定义数据权限关联
* system_role_dept 角色-自定义数据权限关联
*
* @property $id
* @property $role_id
Expand All @@ -21,5 +21,5 @@ class SystemRoleDept extends Pivot
{
protected $primaryKey = 'id';

protected $table = 'sa_system_role_dept';
protected $table = 'system_role_dept';
}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemRoleMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 角色菜单关联模型
*
* sa_system_role_menu 角色权限关联
* system_role_menu 角色权限关联
*
* @property $id
* @property $role_id
Expand All @@ -21,5 +21,5 @@ class SystemRoleMenu extends Pivot
{
protected $primaryKey = 'id';

protected $table = 'sa_system_role_menu';
protected $table = 'system_role_menu';
}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 用户信息模型
*
* sa_system_user 用户表
* system_user 用户表
*
* @property $id
* @property $username 登录账号
Expand Down Expand Up @@ -47,7 +47,7 @@ class SystemUser extends BaseModel
* 数据表完整名称
* @var string
*/
protected $table = 'sa_system_user';
protected $table = 'system_user';

/**
* 关键字搜索
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemUserPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 用户岗位关联模型
*
* sa_system_user_post 用户与岗位关联表
* system_user_post 用户与岗位关联表
*
* @property $id 主键
* @property $user_id 用户主键
Expand All @@ -21,5 +21,5 @@ class SystemUserPost extends Pivot
{
protected $primaryKey = 'id';

protected $table = 'sa_system_user_post';
protected $table = 'system_user_post';
}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/system/SystemUserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 用户角色关联模型
*
* sa_system_user_role 用户角色关联
* system_user_role 用户角色关联
*
* @property $id
* @property $user_id
Expand All @@ -20,7 +20,7 @@
class SystemUserRole extends Pivot
{
protected $primaryKey = 'id';
protected $table = 'sa_system_user_role';
protected $table = 'system_user_role';

/**
* 获取角色id
Expand Down
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/tool/Crontab.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 定时任务模型
*
* sa_tool_crontab 定时任务信息表
* tool_crontab 定时任务信息表
*
* @property $id 主键
* @property $name 任务名称
Expand All @@ -35,6 +35,6 @@ class Crontab extends BaseModel
*/
protected $pk = 'id';

protected $table = 'sa_tool_crontab';
protected $table = 'tool_crontab';

}
4 changes: 2 additions & 2 deletions src/orm/eloquent/app/model/tool/CrontabLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* 定时任务日志模型
*
* sa_tool_crontab_log 定时任务执行日志表
* tool_crontab_log 定时任务执行日志表
*
* @property $id 主键
* @property $crontab_id 任务ID
Expand All @@ -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'];

Expand Down
Loading