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
Compare Revisions
master...fix/send_msg_after_noble
Source
fix/send_msg_after_noble
Select Git revision
...
Target
master
Select Git revision
Compare
Commits (1)
代理家族限制
· e5fc895b
chenweijian
authored
Apr 03, 2023
e5fc895b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
diamond.go
domain/service/diamond_s/diamond.go
+13
-13
No files found.
domain/service/diamond_s/diamond.go
View file @
e5fc895b
...
...
@@ -40,25 +40,25 @@ func (this *DiamondService) CheckDealerTransferFamilyLimit(dealerId, userId uint
return
err
}
// 用户的家族是否有家族代理
var
userHasFamilyAgent
bool
if
userFamily
!=
nil
{
userHasFamilyAgent
,
err
=
groupPower_m
.
IsGroupPowerHasFamilyAgent
(
model
,
userFamily
.
GroupPowerId
)
if
err
!=
nil
{
return
err
}
}
//
var userHasFamilyAgent bool
//
if userFamily != nil {
//
userHasFamilyAgent, err = groupPower_m.IsGroupPowerHasFamilyAgent(model, userFamily.GroupPowerId)
//
if err != nil {
//
return err
//
}
//
}
if
dealerFamily
!=
nil
&&
dealerFamily
.
GroupPowerId
>
0
{
// 代理加入了家族
if
isFamilyAgent
&&
(
userFamily
==
nil
||
userFamily
.
GroupPowerId
!=
dealerFamily
.
GroupPowerId
)
{
// 是家族代理:只能向本家族成员转移钻石,如果向非家族成员转移钻石,则提示“非家族成员”
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_NOT_FAMILY_MEMBER
,
lang
,
bizerr
.
GroupPowerDealerNotMember
))
}
if
!
isFamilyAgent
&&
userHasFamilyAgent
{
// 不是家族代理:如果用户加入了家族,且家族中有家族代理,那么也不能,“此用户已有家族代理,不能出售钻石”
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_DEALER_CAN_NOT_SOLE
,
lang
,
bizerr
.
GroupPowerDealerCanNotSole
))
}
//
if !isFamilyAgent && userHasFamilyAgent { // 不是家族代理:如果用户加入了家族,且家族中有家族代理,那么也不能,“此用户已有家族代理,不能出售钻石”
//
return myerr.WrapErr(res_m.GetErrByLanguage(model.Db, common.MSG_ID_DEALER_CAN_NOT_SOLE, lang, bizerr.GroupPowerDealerCanNotSole))
//
}
}
else
{
// 代理没有加入家族的
// 普通代理:不能向已经加入家族的成员(并且家族有家族代理)转移钻石,如果转移则提示“此用户已有家族代理,不能出售钻石”
if
userHasFamilyAgent
{
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_DEALER_CAN_NOT_SOLE
,
lang
,
bizerr
.
GroupPowerDealerCanNotSole
))
}
//
if userHasFamilyAgent {
//
return myerr.WrapErr(res_m.GetErrByLanguage(model.Db, common.MSG_ID_DEALER_CAN_NOT_SOLE, lang, bizerr.GroupPowerDealerCanNotSole))
//
}
}
return
nil
}