Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
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
chenweijian
hilo-user
Commits
834af6c5
Commit
834af6c5
authored
Mar 15, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:不用上架的礼物都可以在背包
parent
ed788325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
gift.go
domain/model/res_m/gift.go
+3
-3
bag.go
route/user_r/bag.go
+2
-2
No files found.
domain/model/res_m/gift.go
View file @
834af6c5
...
...
@@ -24,11 +24,11 @@ type ResGift struct {
GiftType
mysql
.
Type
}
// 获取所有
有效
的礼物
func
Find
Valid
ResGiftsMap
(
model
*
domain
.
Model
)
(
map
[
mysql
.
ID
]
ResGift
,
error
)
{
// 获取所有的礼物
func
Find
All
ResGiftsMap
(
model
*
domain
.
Model
)
(
map
[
mysql
.
ID
]
ResGift
,
error
)
{
res
:=
make
(
map
[
mysql
.
ID
]
ResGift
,
0
)
rows
:=
make
([]
ResGift
,
0
)
if
err
:=
model
.
DB
()
.
Model
(
ResGift
{})
.
Where
(
"status = ?"
,
mysql
.
USER
)
.
Find
(
&
rows
)
.
Error
;
err
!=
nil
{
if
err
:=
model
.
DB
()
.
Model
(
ResGift
{})
.
Find
(
&
rows
)
.
Error
;
err
!=
nil
{
return
nil
,
err
}
for
i
,
v
:=
range
rows
{
...
...
route/user_r/bag.go
View file @
834af6c5
...
...
@@ -38,12 +38,12 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
return
myCtx
,
err
}
all
ValidGifts
,
err
:=
res_m
.
FindValid
ResGiftsMap
(
model
)
all
Gifts
,
err
:=
res_m
.
FindAll
ResGiftsMap
(
model
)
if
err
!=
nil
{
return
myCtx
,
err
}
for
_
,
bagGift
:=
range
userBagGifts
{
if
gift
,
ok
:=
all
Valid
Gifts
[
bagGift
.
ResId
];
ok
{
if
gift
,
ok
:=
allGifts
[
bagGift
.
ResId
];
ok
{
results
=
append
(
results
,
user_cv
.
UserBag
{
BagId
:
bagGift
.
ID
,
ResType
:
res_e
.
ResUserBagGift
,
...
...
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