|
|
@@ -202,7 +202,10 @@ func RelaySwapFace(c *gin.Context) *dto.MidjourneyResponse {
|
|
|
if quota != 0 {
|
|
|
tokenName := c.GetString("token_name")
|
|
|
logContent := fmt.Sprintf("模型固定价格 %.2f,分组倍率 %.2f,操作 %s", modelPrice, groupRatio, constant.MjActionSwapFace)
|
|
|
- model.RecordConsumeLog(ctx, userId, channelId, 0, 0, modelName, tokenName, quota, logContent, tokenId, userQuota, 0, false)
|
|
|
+ other := make(map[string]interface{})
|
|
|
+ other["model_price"] = modelPrice
|
|
|
+ other["group_ratio"] = groupRatio
|
|
|
+ model.RecordConsumeLog(ctx, userId, channelId, 0, 0, modelName, tokenName, quota, logContent, tokenId, userQuota, 0, false, other)
|
|
|
model.UpdateUserUsedQuotaAndRequestCount(userId, quota)
|
|
|
channelId := c.GetInt("channel_id")
|
|
|
model.UpdateChannelUsedQuota(channelId, quota)
|
|
|
@@ -498,7 +501,10 @@ func RelayMidjourneySubmit(c *gin.Context, relayMode int) *dto.MidjourneyRespons
|
|
|
if quota != 0 {
|
|
|
tokenName := c.GetString("token_name")
|
|
|
logContent := fmt.Sprintf("模型固定价格 %.2f,分组倍率 %.2f,操作 %s", modelPrice, groupRatio, midjRequest.Action)
|
|
|
- model.RecordConsumeLog(ctx, userId, channelId, 0, 0, modelName, tokenName, quota, logContent, tokenId, userQuota, 0, false)
|
|
|
+ other := make(map[string]interface{})
|
|
|
+ other["model_price"] = modelPrice
|
|
|
+ other["group_ratio"] = groupRatio
|
|
|
+ model.RecordConsumeLog(ctx, userId, channelId, 0, 0, modelName, tokenName, quota, logContent, tokenId, userQuota, 0, false, other)
|
|
|
model.UpdateUserUsedQuotaAndRequestCount(userId, quota)
|
|
|
channelId := c.GetInt("channel_id")
|
|
|
model.UpdateChannelUsedQuota(channelId, quota)
|