Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
c4357bf8
Commit
c4357bf8
authored
Mar 14, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族
parent
0a820e67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
groupPower.go
cv/group_power_cv/groupPower.go
+10
-8
family.go
domain/model/groupPower_m/family.go
+4
-4
group_power.go
route/group_power_r/group_power.go
+3
-2
No files found.
cv/group_power_cv/groupPower.go
View file @
c4357bf8
...
...
@@ -650,14 +650,16 @@ type GroupPowerInfo struct {
type
GroupPower
struct
{
Id
uint64
`json:"id"`
Name
mysql
.
Str
`json:"name"`
Nameplate
mysql
.
Str
`json:"nameplate"`
// 铭牌
Declaration
mysql
.
Str
`json:"declaration"`
// 宣言
Icon
mysql
.
Str
`json:"icon"`
// 头像
Grade
mysql
.
Num
`json:"grade" gorm:"-"`
// 等级
Exp
mysql
.
Num
`json:"exp" gorm:"-"`
// 当前经验值
NextExp
mysql
.
Num
`json:"nextExp" gorm:"-"`
// 升到下一级需要的经验值
GradeName
mysql
.
Str
`json:"gradeName"`
// 等级称号
GradeMedal
mysql
.
Str
`json:"gradeMedal"`
// 等级勋章图片
Nameplate
mysql
.
Str
`json:"nameplate"`
// 铭牌
Declaration
mysql
.
Str
`json:"declaration"`
// 宣言
Icon
mysql
.
Str
`json:"icon"`
// 头像
Grade
mysql
.
Num
`json:"grade" gorm:"-"`
// 等级
Exp
mysql
.
Num
`json:"exp" gorm:"-"`
// 当前经验值
NextExp
mysql
.
Num
`json:"nextExp" gorm:"-"`
// 升到下一级需要的经验值
GradeName
mysql
.
Str
`json:"gradeName"`
// 等级称号
GradeMedal
mysql
.
Str
`json:"gradeMedal"`
// 等级勋章图片
MemberNum
mysql
.
Num
`json:"memberNum" gorm:"-"`
// 当前人数
MemberMax
mysql
.
Num
`json:"memberMax" gorm:"-"`
// 最大人数
}
type
GroupPowerUser
struct
{
...
...
domain/model/groupPower_m/family.go
View file @
c4357bf8
...
...
@@ -49,20 +49,20 @@ func (this *GroupPower) Get(model *domain.Model) (*GroupPower, error) {
return
group
,
nil
}
func
(
gpu
*
GroupPowerUser
)
GetBy
(
model
*
domain
.
Model
,
pageSize
,
pageIndex
int
)
([]
*
GroupPowerUser
,
int
,
bool
,
error
)
{
func
(
gpu
*
GroupPowerUser
)
GetBy
(
model
*
domain
.
Model
,
pageSize
,
pageIndex
int
)
([]
*
GroupPowerUser
,
int
64
,
int
,
bool
,
error
)
{
rows
:=
make
([]
*
GroupPowerUser
,
0
)
db
:=
model
.
Db
.
Model
(
GroupPowerUser
{})
.
Where
(
gpu
)
.
Order
(
"field(`role`, 2, 3, 1)"
)
var
count
int64
err
:=
db
.
Count
(
&
count
)
.
Error
if
err
!=
nil
{
return
nil
,
0
,
false
,
err
return
nil
,
0
,
0
,
false
,
err
}
err
=
db
.
Limit
(
pageSize
)
.
Offset
(
pageIndex
-
1
)
.
Find
(
&
rows
)
.
Error
if
err
!=
nil
{
return
nil
,
0
,
false
,
err
return
nil
,
0
,
0
,
false
,
err
}
nextPageIndex
,
hasNextPage
:=
common
.
PageNext
(
count
,
pageIndex
,
pageSize
)
return
rows
,
nextPageIndex
,
hasNextPage
,
nil
return
rows
,
count
,
nextPageIndex
,
hasNextPage
,
nil
}
func
(
gpu
*
GroupPowerUser
)
GetGroupPowerUser
(
model
*
domain
.
Model
)
(
*
GroupPowerUser
,
error
)
{
...
...
route/group_power_r/group_power.go
View file @
c4357bf8
...
...
@@ -717,7 +717,7 @@ func GroupPowerInfo(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
myerr
.
WrapErr
(
err
)
}
gpU
:=
&
groupPower_m
.
GroupPowerUser
{
GroupPowerId
:
gpInfo
.
ID
}
members
,
_
,
_
,
err
:=
gpU
.
GetBy
(
model
,
5
,
0
)
members
,
total
,
_
,
_
,
err
:=
gpU
.
GetBy
(
model
,
5
,
0
)
if
err
!=
nil
{
return
myContext
,
myerr
.
WrapErr
(
err
)
}
...
...
@@ -738,6 +738,7 @@ func GroupPowerInfo(c *gin.Context) (*mycontext.MyContext, error) {
info
:=
&
group_power_cv
.
GroupPower
{
Id
:
gpInfo
.
ID
,
Name
:
gpInfo
.
Name
,
Nameplate
:
gpInfo
.
Nameplate
,
Declaration
:
gpInfo
.
Declaration
,
Icon
:
gpInfo
.
Icon
,
Grade
:
gpInfo
.
Grade
,
Exp
:
gpInfo
.
Exp
,
NextExp
:
gpInfo
.
NextExp
,
GradeName
:
gpInfo
.
GradeName
,
GradeMedal
:
gpInfo
.
GradeMedal
,
MemberNum
:
mysql
.
Num
(
total
),
MemberMax
:
300
,
}
res
:=
group_power_cv
.
GroupPowerInfo
{
Info
:
info
,
Members
:
resMembers
}
...
...
@@ -824,7 +825,7 @@ func GroupPowerMembers(c *gin.Context) (*mycontext.MyContext, error) {
}
}
members
,
nextPageIndex
,
hasNextPage
,
err
:=
gpU
.
GetBy
(
model
,
pageSize
,
pageIndex
)
members
,
_
,
nextPageIndex
,
hasNextPage
,
err
:=
gpU
.
GetBy
(
model
,
pageSize
,
pageIndex
)
if
err
!=
nil
{
return
myContext
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment