|
@@ -2,12 +2,14 @@ package service
|
|
|
|
|
|
import (
|
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
|
- "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
|
|
|
- "fmt"
|
|
|
IC "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/init"
|
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
|
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/util"
|
|
|
+ "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
|
|
|
+ "fmt"
|
|
|
+ "github.com/gogf/gf/v2/util/gconv"
|
|
|
"regexp"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
type PushSetService struct {
|
|
@@ -53,10 +55,23 @@ func (this *PushSetService) Update(item, setType, pushType string, ratemode, pus
|
|
|
update = IC.Mgo.UpdateById(util.USER, this.UserId, map[string]interface{}{
|
|
|
"$set": set,
|
|
|
})
|
|
|
+ data, _ := IC.Mgo.FindById(util.USER, this.UserId, `{"o_pushset":1}`)
|
|
|
+ (*data)["userid"] = this.UserId
|
|
|
+ (*data)["createtime"] = time.Now().Unix()
|
|
|
+ IC.MgoLog.Save("pushset_log", data)
|
|
|
} else {
|
|
|
update = IC.Mgo.Update(util.ENTUSER, map[string]interface{}{"i_entid": this.EntId, "i_userid": this.EntUserId}, map[string]interface{}{
|
|
|
"$set": set,
|
|
|
}, true, false)
|
|
|
+ data, _ := IC.Mgo.FindOne(util.ENTUSER, map[string]interface{}{"i_entid": this.EntId, "i_userid": this.EntUserId})
|
|
|
+ if data != nil {
|
|
|
+ data1 := gconv.Map((*data)["o_pushset"])
|
|
|
+ data1["i_userid"] = this.EntUserId
|
|
|
+ data1["i_entid"] = this.EntId
|
|
|
+ data1["createtime"] = time.Now().Unix()
|
|
|
+ data1["userid"] = this.UserId
|
|
|
+ IC.MgoLog.Save("pushset_log", data)
|
|
|
+ }
|
|
|
}
|
|
|
return update
|
|
|
}
|