添source_type字段(券的来源:1-vip获得,2-认证获得,3-拉新获得),用来判断券的来源,
userinfo接口返回企业统一社会信用代码和营业执照路径
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
. "code.hoteas.com/golang/hotime"
|
||||
. "code.hoteas.com/golang/hotime/common"
|
||||
"code.hoteas.com/golang/hotime/dri/wechat"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Wechath5 = Ctr{
|
||||
@@ -63,6 +64,25 @@ var Wechath5 = Ctr{
|
||||
|
||||
//2022/5/11 zpw 添加字段:用户关联parenid的时间 (join_parent_time)
|
||||
that.Db.Update("user", Map{"parent_id": parentId, "index": index1 + ObjToStr(userId) + ",", "join_parent_time[#]": "NOW()"}, Map{"id": userId})
|
||||
//在这里做判断 能否通过分享领券
|
||||
//如果通过邀请获得的券超过了三张则不再赠送
|
||||
//赠送一张券
|
||||
data := Map{
|
||||
"user_id": parentId,
|
||||
"coupon_id": 1,
|
||||
"code_no": "SN" + time.Now().Format("20060102150405") + getSn(),
|
||||
"effective_start_time[#]": "NOW()",
|
||||
"effective_end_time": "2022-10-01 23:59:59",
|
||||
"source_type": 3,
|
||||
"status": 0,
|
||||
"admin_id": user.GetCeilInt("admin_id"),
|
||||
"create_time[#]": "NOW()",
|
||||
}
|
||||
//先判断是否领取过 source_type=3 是通过拉新赠送的券
|
||||
couponCount := that.Db.Count("coupon_user", Map{"AND": Map{"user_id": parentId, "source_type": 3}})
|
||||
if couponCount < 3 {
|
||||
that.Db.Insert("coupon_user", data)
|
||||
}
|
||||
|
||||
}()
|
||||
//最后验证服务商是否绑定
|
||||
|
||||
Reference in New Issue
Block a user