1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package award
- import (
- "app.yhyue.com/moapp/message/model"
- "app.yhyue.com/moapp/message/rpc"
- "github.com/gogf/gf/v2/util/gconv"
- )
- /*// Jy_user_new 产生新用户
- func (p *Points) Jy_user_new(msg *model.Message) {
- rpc.IntegralHarvest(msg, gcfg.Instance().MustGet(gctx.New(), "docPoints.open.jywx_subscribe_new", nil).Int64(), 1002)
- }
- // Jywx_subscribe_invite 邀请人
- func (p *Points) Jywx_subscribe_invite(msg *model.Message) {
- rpc.IntegralHarvest(msg, gcfg.Instance().MustGet(gctx.New(), "docPoints.open.jywx_subscribe_invite", nil).Int64(), 1003)
- }
- // Jywx_subscribe_invited 被邀请人
- func (p *Points) Jywx_subscribe_invited(msg *model.Message) {
- rpc.IntegralHarvest(msg, gcfg.Instance().MustGet(gctx.New(), "docPoints.open.jywx_subscribe_invited", nil).Int64(), 1002)
- }
- var VarPoints = &Points{}
- */
- type Points struct {
- Num, Type int64 //数量,类型
- From, Desc string //来源活动,描述
- }
- const (
- AwardPoints = "points"
- )
- // GivenPoints 积分奖励
- func GivenPoints(msg *model.Message, p Points) {
- //记录
- if err := rpc.IntegralHarvest(msg, p.Num, p.Type); err == nil {
- AddAwardRecord(AwardRecord{
- UserId: msg.E_userId,
- Award: AwardPoints,
- Num: gconv.Int(p.Num),
- GetWay: p.Desc,
- ActivityCode: p.From,
- Detail: "",
- Date: msg.E_time,
- })
- }
- }
|