作者 yangfu

互动消息 机会补充

... ... @@ -252,7 +252,7 @@ select id msg_id,message content,source_type,source_id,is_read,create_at msg_tim
where receive_user_id =? and (?=0 or id<?) and msg_type=?
)a left outer join chance b on a.chance_id = b.id
)a left outer join chance_data b on a.chance_id = b.chance_id
order by id desc
order by msg_id desc
LIMIT ?`
sqlCount := `select count(0)
... ...
package protocol
const (
RankRangeTypeAllCompanyUser = 1
RankRangeTypeSpecifyUser = 2
RankRangeTypeAllCompanyDepartment = 3
RankRangeTypeAllSpecifyDepartment = 4
)
/*GetRankList 排行榜*/
type GetRankListRequest struct {
RankTypeId int `json:"rankTypeId" valid:"Required"` //榜单类型编号(赛季榜、年榜)
... ...
... ... @@ -11,13 +11,20 @@ import (
var ComputeRankScoreFlag int32
type Rank interface {
RankUser(o RankOption) error
RankDepartment(o RankOption) error
RankUser(o RankOption) (error, RankResult)
RankDepartment(o RankOption) (error, RankResult)
}
type RankOption struct {
Type int //RankRangeType
ObjectId int64 //对象id 用户编号 /部门编号
BeginTime time.Time
EndTime time.Time
//*model.user_rank
}
type RankResult struct {
//Params map[string]interface{}
}
//计算排行分
... ... @@ -40,5 +47,20 @@ func ComputeRankScore() error {
}
func computeRankScore() error {
var (
//rankList []Rank = initRankList()
)
//1.从rank_period 查询进行中的赛季
//2.查询对应 rank_type_id 的rank_data
//按类型
//3.查询用户列表/部门列表
//4.调用统计接口列表
//5.汇聚所有的rankResult
//6.查询当前user_rank是否有这条记录,比较记录里面数据是否有变化
//7.更新到表/插入
return nil
}
func initRankList() []Rank {
return []Rank{}
}
... ...