mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
opt: record user_id for reward verify
This commit is contained in:
parent
e02badf7bb
commit
94d8d8a9d4
@ -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`;
|
Loading…
Reference in New Issue
Block a user