feat: 释放回库存的 Token 优先分配
This commit is contained in:
@@ -224,6 +224,7 @@ func (s *RockService) ReleaseUnboundUsingToken(ctx context.Context, tokenID uint
|
||||
return fmt.Errorf("仅扫码使用中的链接可以释放回库存")
|
||||
}
|
||||
orderNo = token.AssignedOrderNo
|
||||
now := time.Now()
|
||||
if err := tx.Model(&token).Updates(map[string]interface{}{
|
||||
"status": model.RockStatusAvailable,
|
||||
"assigned_order_no": "",
|
||||
@@ -238,7 +239,8 @@ func (s *RockService) ReleaseUnboundUsingToken(ctx context.Context, tokenID uint
|
||||
"using_at": nil,
|
||||
"redeemed_at": nil,
|
||||
"upstream_fulfill_id": 0,
|
||||
"updated_at": time.Now(),
|
||||
"restocked_at": now, // 人工释放回库存:下次分配优先使用
|
||||
"updated_at": now,
|
||||
}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user