fixes #34 「动态指令」多行指令会被当作一行执行

fixes #32 会话无法维持,1分钟左右自动断开
fixes #31 更新"资产"会清空"标签"
fixes #13 建议添加用户权限功能、隐藏授权账户信息
This commit is contained in:
dushixiang
2021-01-18 18:28:33 +08:00
parent c93e03e951
commit c98b3adbe6
26 changed files with 642 additions and 378 deletions

View File

@ -29,13 +29,13 @@ func (r *Command) TableName() string {
func FindPageCommand(pageIndex, pageSize int, name, content string, account User) (o []CommandVo, total int64, err error) {
db := global.DB.Table("commands").Select("commands.id,commands.name,commands.content,commands.owner,commands.created, users.nickname as owner_name,COUNT(resources.user_id) as sharer_count").Joins("left join users on commands.owner = users.id").Joins("left join resources on commands.id = resources.resource_id").Group("commands.id")
dbCounter := global.DB.Table("commands").Select("DISTINCT commands.id").Joins("left join resources on commands.id = resources.resource_id")
db := global.DB.Table("commands").Select("commands.id,commands.name,commands.content,commands.owner,commands.created, users.nickname as owner_name,COUNT(resource_sharers.user_id) as sharer_count").Joins("left join users on commands.owner = users.id").Joins("left join resource_sharers on commands.id = resource_sharers.resource_id").Group("commands.id")
dbCounter := global.DB.Table("commands").Select("DISTINCT commands.id").Joins("left join resource_sharers on commands.id = resource_sharers.resource_id")
if TypeUser == account.Type {
owner := account.ID
db = db.Where("commands.owner = ? or resources.user_id = ?", owner, owner)
dbCounter = dbCounter.Where("commands.owner = ? or resources.user_id = ?", owner, owner)
db = db.Where("commands.owner = ? or resource_sharers.user_id = ?", owner, owner)
dbCounter = dbCounter.Where("commands.owner = ? or resource_sharers.user_id = ?", owner, owner)
}
if len(name) > 0 {