|
@@ -19,11 +19,11 @@ func flushPersonal(ctx context.Context) error {
|
|
|
g.Log().Infof(ctx, "个人数据进度【%d/%d】", i, len(personalList.List()))
|
|
|
}
|
|
|
var (
|
|
|
- userId = gconv.String(m["user_id"])
|
|
|
- filterMap = gconv.Map(m["filter"])
|
|
|
- vip_endtime = gconv.String(m["vip_endtime"])
|
|
|
- order_code = gconv.String(m["order_code"])
|
|
|
- companyId string
|
|
|
+ userId = gconv.String(m["user_id"])
|
|
|
+ filterMap = gconv.Map(m["filter"])
|
|
|
+ vip_endtime = gconv.String(m["vip_endtime"])
|
|
|
+ order_code = gconv.String(m["order_code"])
|
|
|
+ finalUserId string = userId
|
|
|
)
|
|
|
pack, err := getPersonalPackNum(filterMap, vip_endtime)
|
|
|
if err != nil {
|
|
@@ -38,10 +38,10 @@ func flushPersonal(ctx context.Context) error {
|
|
|
eTime = arr[0]
|
|
|
}
|
|
|
|
|
|
- if gconv.Int(m["pay_sub_num"]) > 0 { //个人版主张号共享额度
|
|
|
- companyId = fmt.Sprintf("p_share_%s", userId)
|
|
|
+ if gconv.Int(m["buy_count"]) > 0 { //个人版主张号共享额度
|
|
|
+ finalUserId = fmt.Sprintf("p_share_%s", userId)
|
|
|
}
|
|
|
- if err := pack.InsertDb(companyId, eTime, userId); err != nil {
|
|
|
+ if err := pack.InsertDb("", eTime, finalUserId); err != nil {
|
|
|
g.Log().Errorf(ctx, "flushPersonal插入权益包异常%s %s %v", userId, order_code, err)
|
|
|
}
|
|
|
}
|