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
1efa1434
Commit
1efa1434
authored
Mar 22, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族修改铭牌
parent
06790632
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
family.go
domain/model/groupPower_m/family.go
+3
-2
group_power.go
route/group_power_r/group_power.go
+4
-1
No files found.
domain/model/groupPower_m/family.go
View file @
1efa1434
...
...
@@ -120,7 +120,8 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara
}
if
nameplate
!=
""
{
updateMap
[
"nameplate"
]
=
nameplate
db
=
db
.
Where
(
"not exists (select id from group_power where nameplate = ?)"
,
nameplate
)
db
=
db
.
Joins
(
"left join (SELECT ? `id` FROM group_power WHERE nameplate=?) b on a.id = b.id"
,
familyId
,
nameplate
)
.
Where
(
"b.id is null"
)
}
if
declaration
!=
""
{
updateMap
[
"declaration"
]
=
declaration
...
...
@@ -128,7 +129,7 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara
if
icon
!=
""
{
updateMap
[
"icon"
]
=
icon
}
result
:=
db
.
Where
(
"id = ?"
,
familyId
)
.
Updates
(
updateMap
)
.
Limit
(
1
)
result
:=
db
.
Where
(
"
group_power.
id = ?"
,
familyId
)
.
Updates
(
updateMap
)
.
Limit
(
1
)
if
result
.
Error
!=
nil
{
return
myerr
.
WrapErr
(
result
.
Error
)
}
...
...
route/group_power_r/group_power.go
View file @
1efa1434
...
...
@@ -768,6 +768,9 @@ func GroupPowerInfo(c *gin.Context) (*mycontext.MyContext, error) {
}
if
groupInfo
!=
nil
{
info
.
Nameplate
=
groupInfo
.
Name
if
len
(
info
.
Nameplate
)
>
6
{
info
.
Nameplate
=
info
.
Nameplate
[
:
6
]
}
}
}
// 家族月排名
...
...
@@ -1420,7 +1423,7 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
bizerr
.
GroupPowerChangeNameplate
}
// 检查铭牌长度和唯一性
if
len
(
para
.
Nameplate
)
>
10
{
if
len
(
para
.
Nameplate
)
>
6
{
return
myContext
,
bizerr
.
GroupPowerHaveTooLong
}
if
groupPower_m
.
IsExistsNameplate
(
model
,
para
.
Nameplate
)
{
...
...
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