On a very crude level: you'd assign a unique ID to each ticket. Then have a second table with an entry for each ticket that was currently 'holding'. If the transaction timed out or was cancelled you would delete that 2ndary record. If the ticket was sold you'd create an entry in a 3rd table. To find out which tix were still available you'd left join between the 'all tickets' table and the other two.
发布评论
评论(1)
在非常粗略的层面上:您将为每张票分配一个唯一的 ID。然后有第二个表,其中包含当前“持有”的每张票的条目。如果事务超时或被取消,您将删除第二条记录。如果门票已售出,您将在第三个表中创建一个条目。为了找出哪些票仍然可用,您在“所有票”表和其他两个表之间留下了连接。
On a very crude level: you'd assign a unique ID to each ticket. Then have a second table with an entry for each ticket that was currently 'holding'. If the transaction timed out or was cancelled you would delete that 2ndary record. If the ticket was sold you'd create an entry in a 3rd table. To find out which tix were still available you'd left join between the 'all tickets' table and the other two.