wangchuanjin 3 meses atrás
pai
commit
4aa9df270f
1 arquivos alterados com 9 adições e 14 exclusões
  1. 9 14
      pushentniche/public/util.go

+ 9 - 14
pushentniche/public/util.go

@@ -35,7 +35,7 @@ var (
 	}
 )
 
-//一天的推送总数
+// 一天的推送总数
 func DayCountKey(ymd string, u *UserInfo) string {
 	key := "entniche_daycount_%s_%d_free"
 	if u.Entniche.IsDis == 1 {
@@ -50,12 +50,12 @@ func DayCountKey(ymd string, u *UserInfo) string {
 	return fmt.Sprintf(key, ymd, u.Entniche.UserId)
 }
 
-//是否分发推送
+// 是否分发推送
 func HasDisPushKey(u *UserInfo) string {
 	return fmt.Sprintf("entniche_haspush_%s_%d_dis", NowFormat(Date_yyyyMMdd), u.Entniche.UserId)
 }
 
-//是否订阅推送
+// 是否订阅推送
 func HasPushKey(u *UserInfo) string {
 	key := "entniche_haspush_%s_%d_free"
 	if u.MemberStatus == 1 {
@@ -68,12 +68,12 @@ func HasPushKey(u *UserInfo) string {
 	return fmt.Sprintf(key, NowFormat(Date_yyyyMMdd), u.Entniche.UserId)
 }
 
-//上次提醒时间
+// 上次提醒时间
 func PrevNoMsgTipKey(u *UserInfo) string {
 	return fmt.Sprintf("prev_nomsgtip_%d", u.Entniche.UserId)
 }
 
-//无消息提醒
+// 无消息提醒
 func NoMsgTipKey(u *UserInfo) string {
 	key := "entniche_nomsgtip_%s_%d_free"
 	if u.MemberStatus == 1 {
@@ -86,27 +86,24 @@ func NoMsgTipKey(u *UserInfo) string {
 	return fmt.Sprintf(key, NowFormat(Date_yyyyMMdd), u.Entniche.UserId)
 }
 
-//今天的总推送数
+// 今天的总推送数
 func PushCountKey() string {
 	return fmt.Sprintf("entniche_pushcount_%s", NowFormat(Date_yyyyMMdd))
 }
 
-//
 func PushInfoKey(userId int, infoId string) string {
 	return fmt.Sprintf("entniche_pushinfo_%d_%s", userId, infoId)
 }
 
-//
 func GetUserType(ui *UserInfo) (string, string, string) {
 	t1 := "剑鱼标讯"
-	nicheStatus, vipStatus, memberStatus := 0, 0, 0
+	nicheStatus, vipStatus, memberStatus := ui.NicheStatus, 0, 0
 	if ui.Entniche.IsDis == 1 {
 		memberStatus = ui.Entniche.DisMember
 		vipStatus = ui.Entniche.DisVip
 	} else {
 		memberStatus = ui.MemberStatus
 		vipStatus = ui.VipStatus
-		nicheStatus = ui.NicheStatus
 		if memberStatus == 1 {
 			t1 = "大会员"
 		} else if vipStatus == 1 {
@@ -126,7 +123,7 @@ func GetUserType(ui *UserInfo) (string, string, string) {
 	return t1, t2, t3
 }
 
-//获取分发人员
+// 获取分发人员
 func GetDisUser(ei *Entniche) map[int]*EntRuleUser {
 	myIds := map[int]*EntRuleUser{}
 	for _, v := range EntRuleUsers[ei.DisId] {
@@ -163,7 +160,7 @@ func GetDisUser(ei *Entniche) map[int]*EntRuleUser {
 	return myIds
 }
 
-//推送记录保存到mysql
+// 推送记录保存到mysql
 func SaveToMysql(mysql, pushMysql *Mysql, savePool chan bool, sleep int, isProjectInfo bool, u *UserInfo, matchInfos *SortList, jobTime *time.Time) (int64, int) {
 	savePool <- true
 	defer func() {
@@ -398,7 +395,6 @@ func SaveToMysql(mysql, pushMysql *Mysql, savePool chan bool, sleep int, isProje
 	return unix, pushCount
 }
 
-//
 func InitEnt(mysql *Mysql, mgo *MongodbSim, dbName string, testQuery map[string]interface{}) {
 	InitEnts(mysql)
 	InitEntUsers(mysql)
@@ -410,7 +406,6 @@ func InitEnt(mysql *Mysql, mgo *MongodbSim, dbName string, testQuery map[string]
 	InitMgoEntUsers(mgo, dbName, testQuery)
 }
 
-//
 func ClearEnt() {
 	Ents = map[int]*Ent{}
 	EntUsers = map[int]*EntUser{}