Commit 34d324f1 authored by chenweijian's avatar chenweijian

家族月度排行活动

parent 5abd49f1
......@@ -67,11 +67,31 @@ func GroupPowerMonthRankAct(c *gin.Context) (*mycontext.MyContext, error) {
}
var model = domain.CreateModelContext(myContext)
// 国家区域
_, area, err := user_m.GetUserCountryArea(model, userId)
var area int
// 我的家族
myGroupPower, err := groupPower_m.GetGroupPowerUserOrNil(model, userId)
if err != nil {
model.Log.Errorf("GroupPowerMonthRankAct 获取国家资源错误 userId:%d, err:%v", userId, err)
return myContext, err
}
if myGroupPower != nil && myGroupPower.GroupPowerId > 0 {
//获取势力主
mgrUserId, err := groupPower_m.GetGroupPowerMgr(model, myGroupPower.GroupPowerId)
if err != nil {
return myContext, err
}
_, area, err = user_m.GetUserCountryArea(model, mgrUserId)
if err != nil {
model.Log.Errorf("GroupPowerMonthRankAct 获取国家资源错误 userId:%d, err:%v", userId, err)
return myContext, err
}
}
if area == 0 {
_, area, err = user_m.GetUserCountryArea(model, userId)
if err != nil {
model.Log.Errorf("GroupPowerMonthRankAct 获取国家资源错误 userId:%d, err:%v", userId, err)
return myContext, err
}
}
// 这个月
beginDate, endDate := now.BeginningOfMonth().Format(utils.DATE_FORMAT), now.EndOfMonth().Format(utils.DATE_FORMAT)
response, err := GroupPowerMonthRankActByMonth(model, userId, beginDate, endDate, time.Now().Format(utils.COMPACT_MONTH_FORMAT), area)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment