...
 
Commits (2)
......@@ -8,6 +8,7 @@ import (
"hilo-group/domain/model/diamond_m"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m"
"hilo-group/myerr"
"hilo-group/myerr/bizerr"
)
......@@ -24,6 +25,22 @@ func NewDiamondService(myContext *mycontext.MyContext) *DiamondService {
// 币商转账钻石-家族限制检查
func (this *DiamondService) CheckDealerTransferFamilyLimit(dealerId, userId uint64, lang string) error {
model := domain.CreateModelContext(this.svc.MyContext)
//获取国家信息
_, dealerArea, err := user_m.GetUserCountryArea(model, dealerId)
if err != nil {
model.Log.Errorf("CheckDealerTransferFamilyLimit 获取国家资源错误 dealerId:%d, err:%v", dealerId, err)
return err
}
_, area, err := user_m.GetUserCountryArea(model, userId)
if err != nil {
model.Log.Errorf("CheckDealerTransferFamilyLimit 获取国家资源错误 userId:%d, err:%v", userId, err)
return err
}
if dealerArea != area {
return bizerr.DealerCannotSaleToOtherArea
}
// 代理、用户是否加入了家族
dealerFamily, err := groupPower_m.GetGroupPowerUserOrNil(model, dealerId)
if err != nil {
......
......@@ -94,6 +94,7 @@ var (
GroupPowerChangeNameplate = myerr.NewBusinessCode(15021, "Can only be modified at the silver level", myerr.BusinessData{}) // 修改铭牌不够等级
GroupPowerMemberMax = myerr.NewBusinessCode(15022, "The family size has reached the upper limit", myerr.BusinessData{}) // 家族人数达到上限
GroupPowerCannotJoin = myerr.NewBusinessCode(15023, "You cannot join", myerr.BusinessData{}) // 不能加入家族
DealerCannotSaleToOtherArea = myerr.NewBusinessCode(15024, "Fail", myerr.BusinessData{}) // 代理转账失败-不同地区
TaskHasAward = myerr.NewBusinessCode(19001, "task has award", myerr.BusinessData{})
......