Commit df074b78 authored by hujiebin's avatar hujiebin

Merge branch 'master' into feature/encrypt

parents 8145bea5 54d5ceeb
...@@ -15,9 +15,11 @@ type GroupPowerExpRank struct { ...@@ -15,9 +15,11 @@ type GroupPowerExpRank struct {
// 获取家族经验排行榜 // 获取家族经验排行榜
// param limit: 排行榜人数 // param limit: 排行榜人数
// 10166 线上员工,对应的势力不上榜,groupPowerId=8951
func GetGroupPowerExpRank(model *domain.Model, beginDate, endDate string, limit int, gpStatus groupPower_e.GroupPowerStatus, area int) ([]GroupPowerExpRank, error) { func GetGroupPowerExpRank(model *domain.Model, beginDate, endDate string, limit int, gpStatus groupPower_e.GroupPowerStatus, area int) ([]GroupPowerExpRank, error) {
var res []GroupPowerExpRank var res []GroupPowerExpRank
db := model.DB().Table("group_power_day_exp gpd").Select("gpd.group_power_id,SUM(gpd.exp) as exp"). db := model.DB().Table("group_power_day_exp gpd").Select("gpd.group_power_id,SUM(gpd.exp) as exp").
Where("gpd.group_power_id <> 8951").
Where("gpd.date BETWEEN ? AND ?", beginDate, endDate) Where("gpd.date BETWEEN ? AND ?", beginDate, endDate)
if gpStatus > 0 { if gpStatus > 0 {
db = db.Joins("left join group_power gp on gpd.group_power_id = gp.id").Where("gp.status = ?", gpStatus) db = db.Joins("left join group_power gp on gpd.group_power_id = gp.id").Where("gp.status = ?", gpStatus)
......
...@@ -3,10 +3,12 @@ package user_m ...@@ -3,10 +3,12 @@ package user_m
import ( import (
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/mysql" "git.hilo.cn/hilo-common/resource/mysql"
"gorm.io/gorm"
"hilo-group/myerr" "hilo-group/myerr"
) )
//获取用户的国家,和所属的区域(是否阿语区) // 获取用户的国家,和所属的区域(是否阿语区)
// 默认国家给沙特
func GetUserCountryArea(model *domain.Model, id mysql.ID) (string, int, error) { func GetUserCountryArea(model *domain.Model, id mysql.ID) (string, int, error) {
type info struct { type info struct {
Name string Name string
...@@ -14,7 +16,11 @@ func GetUserCountryArea(model *domain.Model, id mysql.ID) (string, int, error) { ...@@ -14,7 +16,11 @@ func GetUserCountryArea(model *domain.Model, id mysql.ID) (string, int, error) {
} }
res := new(info) res := new(info)
if err := model.DB().Raw("select name, area from res_country where name = (select country from user where id = ?)", id).First(&res).Error; err != nil { if err := model.DB().Raw("select name, area from res_country where name = (select country from user where id = ?)", id).First(&res).Error; err != nil {
return "", 0, myerr.WrapErr(err) if err != gorm.ErrRecordNotFound {
return "", 0, myerr.WrapErr(err)
}
// gorm.ErrRecordNotFound
return "KSA", 1, nil
} }
return res.Name, res.Area, nil return res.Name, res.Area, nil
} }
...@@ -1738,6 +1738,10 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1738,6 +1738,10 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
password := c.PostForm("password") password := c.PostForm("password")
enterType := c.PostForm("enterType") enterType := c.PostForm("enterType")
gameCode := c.PostForm("gameCode") gameCode := c.PostForm("gameCode")
// 把id:9 添加进房间:5030的黑名单
if (userId == 2087771 || userId == 1763211) && groupId == "HTGS#a46766257" {
return myContext, bizerr.NoPrivileges
}
model := domain.CreateModelContext(myContext) model := domain.CreateModelContext(myContext)
gi, err := group_m.GetInfoByTxGroupId(model, groupId) gi, err := group_m.GetInfoByTxGroupId(model, groupId)
......
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