Documentation ¶
Index ¶
- Variables
- func AppendLog(args *ArgsAppendLog) (errCode string, err error)
- func CheckHaveLogByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, ...) (b bool)
- func CheckLastTimeHaveLogByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, ...) (b bool)
- func GetLogCountByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, ...) (count int64)
- func GetLogCountByUserID(action string, bindID int64, orgID int64, orgBindID int64, userID int64) (count int64)
- func GetLogSUMByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, ...) (count int64)
- func Init()
- type ArgsAppendLog
- type ArgsGetLogList
- type FieldsLog
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //OpenSub 是否启动订阅 OpenSub = false )
Functions ¶
func CheckHaveLogByFrom ¶
func CheckHaveLogByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, bindUserID int64) (b bool)
CheckHaveLogByFrom 检查被奖励目标奖励是否存在
func CheckLastTimeHaveLogByFrom ¶
func CheckLastTimeHaveLogByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, bindUserID int64, afterAt time.Time) (b bool)
CheckLastTimeHaveLogByFrom 检查被奖励目标是否在指定时间段后存在奖励
func GetLogCountByFrom ¶
func GetLogCountByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, bindUserID int64) (count int64)
GetLogCountByFrom 合计统计指定的次数
func GetLogCountByUserID ¶
func GetLogCountByUserID(action string, bindID int64, orgID int64, orgBindID int64, userID int64) (count int64)
GetLogCountByUserID 获取推荐了多少人/获取了多少次奖励
Types ¶
type ArgsAppendLog ¶
type ArgsAppendLog struct { //组织ID OrgID int64 `db:"org_id" json:"orgID"` //成员ID // 允许给0,系统将自动根据orgID和用户ID找到匹配的组织成员 OrgBindID int64 `db:"org_bind_id" json:"orgBindID"` //用户ID // 得到奖励的用户 UserID int64 `db:"user_id" json:"userID"` //触发奖励的设置ID BindID int64 `db:"bind_id" json:"bindID"` //触发的用户 BindUserID int64 `db:"bind_user_id" json:"bindUserID"` //奖励积分 GivingUserIntegral int64 `db:"giving_user_integral" json:"givingUserIntegral"` //奖励资金 // savings 储蓄; deposit 押金; free 免费资金 GivingDepositType string `db:"giving_deposit_type" json:"givingDepositType"` GivingDepositPrice int64 `db:"giving_deposit_price" json:"givingDepositPrice"` //奖励票据 GivingTicketConfigID int64 `db:"giving_ticket_config_id" json:"givingTicketConfigID"` GivingTicketCount int64 `db:"giving_ticket_count" json:"givingTicketCount"` //奖励会员 GivingUserSubAddHour int64 `db:"giving_user_sub_add_hour" json:"givingUserSubAddHour"` //行为范畴 // 聚合统计中,按照本行为的列队行为具体定义 // 0 new_user 新用户奖励; 1 referrer_new_user 邀请新用户奖励; 2 qrcode 扫码奖励; 3 user_sub 用户会员奖励; 4 referrer_user_sub 推荐用户会员奖励 Action string `db:"action" json:"action"` //奖励原因描述 Des string `db:"des" json:"des"` //扩展参数 Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"` //同一个行为禁止重复 // 同一个被奖励来源和触发奖励来源,将被禁止触发奖励 // 如果是存在时间限制为主,请在外围具体实施模块加以判断处理后提交给本方法,同时禁止使用此参数,避免永久性无法触发 NoReplaceByFrom bool `json:"noReplaceByFrom"` //资源导向的来源组织 // 相关奖励资源的让渡方 SourceOrgID int64 `json:"sourceOrgID"` }
ArgsAppendLog 添加新的日志参数
type ArgsGetLogList ¶
type ArgsGetLogList struct { //分页 Pages CoreSQLPages.ArgsDataList `json:"pages"` //组织ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //成员ID OrgBindID int64 `db:"org_bind_id" json:"orgBindID" check:"id" empty:"true"` //对表成员的用户ID // 和成员对等,可用于一次性推荐的记录处理 UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"` //触发奖励的设置ID BindID int64 `db:"bind_id" json:"bindID" check:"id" empty:"true"` //行为范畴 Action string `db:"action" json:"action" check:"mark" empty:"true"` }
ArgsGetLogList 获取日志列表参数
type FieldsLog ¶
type FieldsLog struct { //ID ID int64 `db:"id" json:"id"` //创建时间 CreateAt time.Time `db:"create_at" json:"createAt"` //组织ID OrgID int64 `db:"org_id" json:"orgID"` //成员ID OrgBindID int64 `db:"org_bind_id" json:"orgBindID"` //用户ID // 得到奖励的用户/推荐的人 UserID int64 `db:"user_id" json:"userID"` //触发奖励的设置ID // 部分奖励模式下,将给与0,因为这些奖励没有具体的设置 // 只有具体设置才会给与值 BindID int64 `db:"bind_id" json:"bindID"` //触发的用户 BindUserID int64 `db:"bind_user_id" json:"bindUserID"` //奖励积分 GivingUserIntegral int64 `db:"giving_user_integral" json:"givingUserIntegral"` //奖励资金 // savings 储蓄; deposit 押金; free 免费资金 GivingDepositType string `db:"giving_deposit_type" json:"givingDepositType"` GivingDepositPrice int64 `db:"giving_deposit_price" json:"givingDepositPrice"` //奖励票据 GivingTicketConfigID int64 `db:"giving_ticket_config_id" json:"givingTicketConfigID"` GivingTicketCount int64 `db:"giving_ticket_count" json:"givingTicketCount"` //奖励会员 GivingUserSubAddHour int64 `db:"giving_user_sub_add_hour" json:"givingUserSubAddHour"` //行为范畴 // 聚合统计中,按照本行为的列队行为具体定义 // 0 new_user 新用户奖励; 1 referrer_new_user 邀请新用户奖励; 2 qrcode 扫码奖励; 3 user_sub 用户会员奖励; 4 referrer_user_sub 推荐用户会员奖励 Action string `db:"action" json:"action"` //奖励原因描述 Des string `db:"des" json:"des"` //扩展参数 Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"` }
FieldsLog 奖励记录
func GetLastLogByFrom ¶
func GetLastLogByFrom(action string, bindID int64, orgID int64, orgBindID int64, userID int64, bindUserID int64) (data FieldsLog)
GetLastLogByFrom 获取被奖励目标最后一次奖励
func GetLogList ¶
func GetLogList(args *ArgsGetLogList) (dataList []FieldsLog, dataCount int64, err error)
GetLogList 获取日志列表
Source Files ¶
Click to show internal directories.
Click to hide internal directories.