|
@@ -1,6 +1,7 @@
|
|
package entity
|
|
package entity
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "config"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
"log"
|
|
"log"
|
|
@@ -30,6 +31,10 @@ func (this *ShareFission) AddPower() {
|
|
Power(this.SharedUid, "shared")
|
|
Power(this.SharedUid, "shared")
|
|
Power(this.ShareUid, "share")
|
|
Power(this.ShareUid, "share")
|
|
this.Record()
|
|
this.Record()
|
|
|
|
+ //推送
|
|
|
|
+ if r, _ := util.MQFW.FindById("user", this.ShareUid, `{"s_m_openid": 1,"s_jpushid":1,"s_opushid":1,"s_appponetype":1,"s_nickname":1,"i_ispush":1,}`); r != nil && len(*r) > 0 {
|
|
|
|
+ util.SendPush(*r, config.Config.AppPushServiceRpc, this.ShareUid)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -51,8 +56,8 @@ func Power(userid, identity string) bool {
|
|
loc, _ := time.LoadLocation("Local")
|
|
loc, _ := time.LoadLocation("Local")
|
|
end, _ := time.ParseInLocation(qu.Date_Full_Layout, endDate, loc)
|
|
end, _ := time.ParseInLocation(qu.Date_Full_Layout, endDate, loc)
|
|
setMap := map[string]interface{}{}
|
|
setMap := map[string]interface{}{}
|
|
- if identity == "shared" {
|
|
|
|
- if i_shareCount := qu.IntAll((*data)["i_shareCount"]); i_shareCount > 4 {
|
|
|
|
|
|
+ if identity == "share" {
|
|
|
|
+ if i_shareCount := qu.IntAll((*data)["i_shareCount"]); i_shareCount >= 4 {
|
|
log.Println(fmt.Sprintf("%s用户已达邀请奖励上限,停止赠送权益,身份:%s", userid, identity))
|
|
log.Println(fmt.Sprintf("%s用户已达邀请奖励上限,停止赠送权益,身份:%s", userid, identity))
|
|
return false
|
|
return false
|
|
}
|
|
}
|