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
e5fc895b
Commit
e5fc895b
authored
Apr 03, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理家族限制
parent
67801c2c
Changes
1
Hide 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
...
@@ -40,25 +40,25 @@ func (this *DiamondService) CheckDealerTransferFamilyLimit(dealerId, userId uint
return
err
return
err
}
}
// 用户的家族是否有家族代理
// 用户的家族是否有家族代理
var
userHasFamilyAgent
bool
//
var userHasFamilyAgent bool
if
userFamily
!=
nil
{
//
if userFamily != nil {
userHasFamilyAgent
,
err
=
groupPower_m
.
IsGroupPowerHasFamilyAgent
(
model
,
userFamily
.
GroupPowerId
)
//
userHasFamilyAgent, err = groupPower_m.IsGroupPowerHasFamilyAgent(model, userFamily.GroupPowerId)
if
err
!=
nil
{
//
if err != nil {
return
err
//
return err
}
//
}
}
//
}
if
dealerFamily
!=
nil
&&
dealerFamily
.
GroupPowerId
>
0
{
// 代理加入了家族
if
dealerFamily
!=
nil
&&
dealerFamily
.
GroupPowerId
>
0
{
// 代理加入了家族
if
isFamilyAgent
&&
(
userFamily
==
nil
||
userFamily
.
GroupPowerId
!=
dealerFamily
.
GroupPowerId
)
{
// 是家族代理:只能向本家族成员转移钻石,如果向非家族成员转移钻石,则提示“非家族成员”
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
))
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_NOT_FAMILY_MEMBER
,
lang
,
bizerr
.
GroupPowerDealerNotMember
))
}
}
if
!
isFamilyAgent
&&
userHasFamilyAgent
{
// 不是家族代理:如果用户加入了家族,且家族中有家族代理,那么也不能,“此用户已有家族代理,不能出售钻石”
//
if !isFamilyAgent && userHasFamilyAgent { // 不是家族代理:如果用户加入了家族,且家族中有家族代理,那么也不能,“此用户已有家族代理,不能出售钻石”
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_DEALER_CAN_NOT_SOLE
,
lang
,
bizerr
.
GroupPowerDealerCanNotSole
))
//
return myerr.WrapErr(res_m.GetErrByLanguage(model.Db, common.MSG_ID_DEALER_CAN_NOT_SOLE, lang, bizerr.GroupPowerDealerCanNotSole))
}
//
}
}
else
{
// 代理没有加入家族的
}
else
{
// 代理没有加入家族的
// 普通代理:不能向已经加入家族的成员(并且家族有家族代理)转移钻石,如果转移则提示“此用户已有家族代理,不能出售钻石”
// 普通代理:不能向已经加入家族的成员(并且家族有家族代理)转移钻石,如果转移则提示“此用户已有家族代理,不能出售钻石”
if
userHasFamilyAgent
{
//
if userHasFamilyAgent {
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_DEALER_CAN_NOT_SOLE
,
lang
,
bizerr
.
GroupPowerDealerCanNotSole
))
//
return myerr.WrapErr(res_m.GetErrByLanguage(model.Db, common.MSG_ID_DEALER_CAN_NOT_SOLE, lang, bizerr.GroupPowerDealerCanNotSole))
}
//
}
}
}
return
nil
return
nil
}
}
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