feat: 小程序超级个体/个人资料/CKB获客;VIP列表展示过滤;管理端与API联调
- 超级个体:去掉首位特例;列表仅展示有头像且非微信默认昵称(vip.go) - 个人资料:居中头像、低调联系方式、点头像优先走存客宝 lead(ckbLeadToken) - 阅读页分享朋友圈复制与 toast 去重 - soul-api: miniprogram users 带 ckbLeadToken;其它 handler 与路由调整 - 脚本:content_upload、miniprogram 上传辅助等 Made-with: Cursor
This commit is contained in:
@@ -330,6 +330,13 @@ func getStringValue(ptr *string) string {
|
||||
return *ptr
|
||||
}
|
||||
|
||||
func getUrlValue(ptr *string) string {
|
||||
if ptr == nil {
|
||||
return ""
|
||||
}
|
||||
return *ptr
|
||||
}
|
||||
|
||||
func getBoolValue(ptr *bool) bool {
|
||||
if ptr == nil {
|
||||
return false
|
||||
@@ -505,18 +512,18 @@ func miniprogramPayPost(c *gin.Context) {
|
||||
status := "created"
|
||||
pm := "wechat"
|
||||
order := model.Order{
|
||||
ID: orderSn,
|
||||
OrderSN: orderSn,
|
||||
UserID: userID,
|
||||
OpenID: req.OpenID,
|
||||
ProductType: req.ProductType,
|
||||
ProductID: &productID,
|
||||
Amount: finalAmount,
|
||||
Description: &description,
|
||||
Status: &status,
|
||||
ReferrerID: referrerID,
|
||||
ReferralCode: &req.ReferralCode,
|
||||
PaymentMethod: &pm,
|
||||
ID: orderSn,
|
||||
OrderSN: orderSn,
|
||||
UserID: userID,
|
||||
OpenID: req.OpenID,
|
||||
ProductType: req.ProductType,
|
||||
ProductID: &productID,
|
||||
Amount: finalAmount,
|
||||
Description: &description,
|
||||
Status: &status,
|
||||
ReferrerID: referrerID,
|
||||
ReferralCode: &req.ReferralCode,
|
||||
PaymentMethod: &pm,
|
||||
}
|
||||
if err := db.Create(&order).Error; err != nil {
|
||||
fmt.Printf("[MiniprogramPay] 插入订单失败: %v\n", err)
|
||||
@@ -739,10 +746,10 @@ func MiniprogramPayNotify(c *gin.Context) {
|
||||
}
|
||||
db.Model(&model.GiftPayRequest{}).Where("request_sn = ?", giftPayRequestSn).
|
||||
Updates(map[string]interface{}{
|
||||
"status": "paid",
|
||||
"payer_user_id": payerUserID,
|
||||
"order_id": orderSn,
|
||||
"updated_at": time.Now(),
|
||||
"status": "paid",
|
||||
"payer_user_id": payerUserID,
|
||||
"order_id": orderSn,
|
||||
"updated_at": time.Now(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1101,29 +1108,30 @@ func MiniprogramUsers(c *gin.Context) {
|
||||
}
|
||||
// 用户信息与会员资料(vip*)、P3 资料扩展,供会员详情页完整展示
|
||||
item := gin.H{
|
||||
"id": user.ID,
|
||||
"nickname": getStringValue(user.Nickname),
|
||||
"avatar": resolveAvatarURL(getStringValue(user.Avatar)),
|
||||
"phone": getStringValue(user.Phone),
|
||||
"wechatId": getStringValue(user.WechatID),
|
||||
"vipName": getStringValue(user.VipName),
|
||||
"vipAvatar": resolveAvatarURL(getStringValue(user.VipAvatar)),
|
||||
"vipContact": getStringValue(user.VipContact),
|
||||
"vipProject": getStringValue(user.VipProject),
|
||||
"vipBio": getStringValue(user.VipBio),
|
||||
"mbti": getStringValue(user.Mbti),
|
||||
"region": getStringValue(user.Region),
|
||||
"industry": getStringValue(user.Industry),
|
||||
"position": getStringValue(user.Position),
|
||||
"businessScale": getStringValue(user.BusinessScale),
|
||||
"skills": getStringValue(user.Skills),
|
||||
"storyBestMonth": getStringValue(user.StoryBestMonth),
|
||||
"id": user.ID,
|
||||
"ckbLeadToken": personLeadTokenByUserID(db, user.ID),
|
||||
"nickname": getStringValue(user.Nickname),
|
||||
"avatar": resolveAvatarURL(getStringValue(user.Avatar)),
|
||||
"phone": getStringValue(user.Phone),
|
||||
"wechatId": getStringValue(user.WechatID),
|
||||
"vipName": getStringValue(user.VipName),
|
||||
"vipAvatar": resolveAvatarURL(getStringValue(user.VipAvatar)),
|
||||
"vipContact": getStringValue(user.VipContact),
|
||||
"vipProject": getStringValue(user.VipProject),
|
||||
"vipBio": getStringValue(user.VipBio),
|
||||
"mbti": getStringValue(user.Mbti),
|
||||
"region": getStringValue(user.Region),
|
||||
"industry": getStringValue(user.Industry),
|
||||
"position": getStringValue(user.Position),
|
||||
"businessScale": getStringValue(user.BusinessScale),
|
||||
"skills": getStringValue(user.Skills),
|
||||
"storyBestMonth": getStringValue(user.StoryBestMonth),
|
||||
"storyAchievement": getStringValue(user.StoryAchievement),
|
||||
"storyTurning": getStringValue(user.StoryTurning),
|
||||
"helpOffer": getStringValue(user.HelpOffer),
|
||||
"helpNeed": getStringValue(user.HelpNeed),
|
||||
"projectIntro": getStringValue(user.ProjectIntro),
|
||||
"is_vip": isVipActive,
|
||||
"storyTurning": getStringValue(user.StoryTurning),
|
||||
"helpOffer": getStringValue(user.HelpOffer),
|
||||
"helpNeed": getStringValue(user.HelpNeed),
|
||||
"projectIntro": getStringValue(user.ProjectIntro),
|
||||
"is_vip": isVipActive,
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": item})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user