mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	opt: record user_id for reward verify
This commit is contained in:
		@@ -59,6 +59,7 @@ func (h *RewardHandler) Verify(c *gin.Context) {
 | 
			
		||||
 | 
			
		||||
	// 更新核销状态
 | 
			
		||||
	item.Status = true
 | 
			
		||||
	item.UserId = user.Id
 | 
			
		||||
	res = h.db.Updates(&item)
 | 
			
		||||
	if res.Error != nil {
 | 
			
		||||
		tx.Rollback()
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ package model
 | 
			
		||||
 | 
			
		||||
type Reward struct {
 | 
			
		||||
	BaseModel
 | 
			
		||||
	UserId uint    // 用户 ID
 | 
			
		||||
	TxId   string  // 交易ID
 | 
			
		||||
	Amount float64 // 打赏金额
 | 
			
		||||
	Remark string  // 打赏备注
 | 
			
		||||
 
 | 
			
		||||
@@ -16,4 +16,6 @@ ALTER TABLE `chatgpt_rewards`
 | 
			
		||||
ALTER TABLE `chatgpt_rewards`
 | 
			
		||||
    MODIFY `id` int NOT NULL AUTO_INCREMENT;
 | 
			
		||||
 | 
			
		||||
update chatgpt_users set calls=0
 | 
			
		||||
update chatgpt_users set calls=0
 | 
			
		||||
 | 
			
		||||
ALTER TABLE `chatgpt_rewards` ADD `user_id` INT(11) NOT NULL COMMENT '用户 ID' AFTER `id`;
 | 
			
		||||
		Reference in New Issue
	
	Block a user