finish refund

This commit is contained in:
2024-08-22 14:33:36 +02:00
parent 7635a9826f
commit 059638f3a7
6 changed files with 89 additions and 35 deletions

View File

@ -413,3 +413,16 @@ func (m *DBModel) GetOrderByID(ID int) (Order, error) {
}
return o, nil
}
func (m *DBModel) UpdateOrderStatus(id, statusID int) error {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
stmt := `UPDATE orders SET status_id = ? where id = ?`
_, err := m.DB.ExecContext(ctx, stmt, statusID, id)
if err != nil {
return err
}
return nil
}