Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
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-common
Commits
46669f1f
Commit
46669f1f
authored
Mar 24, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create sync_group_power_icon.go
parent
7b34d5a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
sync_group_power_icon.go
script/sync_group_power_icon.go
+26
-0
No files found.
script/sync_group_power_icon.go
0 → 100644
View file @
46669f1f
package
main
import
(
"git.hilo.cn/hilo-common/script/model"
"git.hilo.cn/hilo-common/script/mysql"
)
func
main
()
{
var
powerOwners
[]
model
.
GroupPowerUser
if
err
:=
mysql
.
ProdReadOnlyDB
.
Model
(
model
.
GroupPowerUser
{})
.
Where
(
"role = 2"
)
.
Find
(
&
powerOwners
)
.
Error
;
err
!=
nil
{
panic
(
err
)
}
for
_
,
owner
:=
range
powerOwners
{
var
groupInfo
model
.
GroupInfo
if
err
:=
mysql
.
ProdReadOnlyDB
.
Model
(
model
.
GroupInfo
{})
.
Where
(
"owner = ?"
,
owner
.
UserId
)
.
First
(
&
groupInfo
)
.
Error
;
err
!=
nil
{
continue
}
if
owner
.
GroupPowerId
<=
0
{
panic
(
"0 powerId"
)
}
if
err
:=
mysql
.
ProdWriteDB
.
Model
(
model
.
GroupPower
{})
.
Where
(
"id = ?"
,
owner
.
GroupPowerId
)
.
UpdateColumn
(
"icon"
,
groupInfo
.
FaceUrl
)
.
Error
;
err
!=
nil
{
panic
(
err
)
}
//break
}
}
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