我有一个事务表,其结构如下:
| transaction_id | customer_id | amount | transaction_type_id | status |
transaction_id => is the id of the transaction
customer_id => is the customer id who did the transaction
amount => Total transaction amount
transaction_type_id => Type of transaction
status => status of the transaction => pending, complete, canceled
我想为我的程序创建拆分账单功能,该功能的工作方式如下:
到目前为止,我已经通过创建主split_bill表和split_bill_request这样来解决该解决方案:
split_bill
split_bill_id|transaction_ids | initiator | total_amount
split_bill_id => id of the split bill
transaction_ids => All the customer transaction id separated by comma
initiator => the customer_id who initiate split bill
total_amount => total of the bill
split_bill_request
split_bill_request_id | split_bill_id | customer_id | status
split_bill_request_id => id of split bill request
split_bill_id => id of the split bill
customer_id => id of the customer who receive split bill request from initiator
status => status of the request pending,accept,reject
我不知道这是否是正确的方法,您能否建议另一种方法,因为我对split_bill表中的transaction_ids或执行此操作的有效方法有疑问,并且我没有权限修改交易表?