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
9e102f8e
Commit
9e102f8e
authored
Jun 30, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
派对邀请
parent
4875e396
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
invite_apply.go
cv/invite_cv/invite_apply.go
+13
-7
invite_apply.go
domain/model/invite_m/invite_apply.go
+18
-0
party_invite.go
route/invite_r/party_invite.go
+14
-1
No files found.
cv/invite_cv/invite_apply.go
View file @
9e102f8e
...
...
@@ -18,4 +18,10 @@ type InviteApplyRes struct {
CreateUnix
int64
`json:"createUnix"`
Level
string
`json:"level"`
Status
uint8
`json:"status"`
// 状态0.未审核1.已通过2.已拒绝
NumList
[]
*
InviteApplyNumRes
`json:"numList"`
}
type
InviteApplyNumRes
struct
{
Type
int
`json:"type"`
// 1.已申请2.待审核3.已通过4.已拒绝"
Num
int
`json:"num"`
}
domain/model/invite_m/invite_apply.go
View file @
9e102f8e
...
...
@@ -63,3 +63,21 @@ func IsInInviteApply(model *domain.Model, userId mysql.ID) (bool, error) {
// err == nil, record exists
return
true
,
nil
}
// 检查被邀请人是否存在
func
GetInviteApplyNumByType
(
model
*
domain
.
Model
,
gType
int
,
beginTime
,
endTime
time
.
Time
)
(
int
,
error
)
{
var
count
int64
db
:=
model
.
Db
.
Model
(
InviteApply
{})
.
Where
(
"created_time >= ? and created_time <= ?"
,
beginTime
,
endTime
)
switch
gType
{
// 1.已申请2.待审核3.已通过4.已拒绝
case
2
:
db
=
db
.
Where
(
"`status` = ?"
,
0
)
case
3
:
db
=
db
.
Where
(
"`status` = ?"
,
1
)
case
4
:
db
=
db
.
Where
(
"`status` = ?"
,
2
)
}
if
err
:=
db
.
Count
(
&
count
)
.
Error
;
err
!=
nil
{
return
0
,
err
}
return
int
(
count
),
nil
}
route/invite_r/party_invite.go
View file @
9e102f8e
...
...
@@ -139,7 +139,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
if
err
:=
c
.
ShouldBindQuery
(
&
param
);
err
!=
nil
{
return
myCtx
,
err
}
if
param
.
Type
<
1
||
param
.
Type
>
4
{
if
param
.
Type
<
0
||
param
.
Type
>
4
{
return
myCtx
,
bizerr
.
InvalidParameter
}
...
...
@@ -159,6 +159,19 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
var
model
=
domain
.
CreateModelContext
(
myCtx
)
if
param
.
Type
==
0
{
// 返回所有Type类型有多少条数
res
:=
&
invite_cv
.
InviteApplyRes
{
NumList
:
make
([]
*
invite_cv
.
InviteApplyNumRes
,
0
,
4
)}
for
_
,
gType
:=
range
[]
int
{
1
,
2
,
3
,
4
}
{
// 1.已申请2.待审核3.已通过4.已拒绝
num
,
err
:=
invite_m
.
GetInviteApplyNumByType
(
model
,
gType
,
param
.
BeginTime
,
param
.
EndTime
)
if
err
!=
nil
{
return
myCtx
,
err
}
res
.
NumList
=
append
(
res
.
NumList
,
&
invite_cv
.
InviteApplyNumRes
{
Type
:
gType
,
Num
:
num
})
}
resp
.
ResponsePageOk
(
c
,
[]
*
invite_cv
.
InviteApplyRes
{
res
},
0
,
0
,
0
)
return
myCtx
,
nil
}
agentIds
:=
[]
uint64
{
userId
}
if
promotion_m
.
IsPromotionManager
(
model
,
userId
)
{
agentIds
,
err
=
promotion_m
.
GetPromotionManagerAgentList
(
model
,
userId
)
...
...
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