feat: 完成20260315用户管理3全部5个功能
1. 链接人和事:补充CKB_OPEN_API_KEY/ACCOUNT配置,新增fix-ckb批量创建获客计划API 2. 规则配置:打通DB规则与ruleEngine,新增/api/miniprogram/user-rules接口, ruleEngine改为从API动态加载规则并按enabled状态执行 3. 获客计划:修复获客数统计中personId/token不匹配导致永远为0的bug, 管理端新增"修复CKB密钥"按钮 4. 支付问题:修复钱包充值和代付分享中openId缺失导致400错误, 添加getOpenId()兜底逻辑 5. 朋友圈分享:shareToMoments改为复制文章前200字+省略号+手指箭头emoji Made-with: Cursor
This commit is contained in:
@@ -1016,7 +1016,7 @@ func getStandardPrice(db *gorm.DB, productType, productID string) (float64, erro
|
||||
}
|
||||
return 0, fmt.Errorf("未知商品类型: %s", productType)
|
||||
|
||||
case "section":
|
||||
case "section", "gift":
|
||||
if productID == "" {
|
||||
return 0, fmt.Errorf("单章购买缺少 productId")
|
||||
}
|
||||
@@ -1032,6 +1032,19 @@ func getStandardPrice(db *gorm.DB, productType, productID string) (float64, erro
|
||||
}
|
||||
return *ch.Price, nil
|
||||
|
||||
case "balance_recharge":
|
||||
if productID == "" {
|
||||
return 0, fmt.Errorf("充值订单号缺失")
|
||||
}
|
||||
var order model.Order
|
||||
if err := db.Where("order_sn = ? AND product_type = ?", productID, "balance_recharge").First(&order).Error; err != nil {
|
||||
return 0, fmt.Errorf("充值订单不存在: %s", productID)
|
||||
}
|
||||
if order.Amount <= 0 {
|
||||
return 0, fmt.Errorf("充值金额无效")
|
||||
}
|
||||
return order.Amount, nil
|
||||
|
||||
default:
|
||||
return 0, fmt.Errorf("未知商品类型: %s", productType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user