I did write about the coupon function when I was making an app before. To put it simply, you need at least two tables for coupons, depending on the complexity of your business. 1. Basic table, which stores the basic information of coupons. Do not store other fields, such as coupon name, face value, attributes, source, status, etc.; 2. Association table, coupon ID, coupon usage rules, etc. Of course, this depends on your business. You may need more tables, related products, related users...
I did write about the coupon function when I was making an app before. To put it simply, you need at least two tables for coupons, depending on the complexity of your business.
1. Basic table, which stores the basic information of coupons. Do not store other fields, such as coupon name, face value, attributes, source, status, etc.;
2. Association table, coupon ID, coupon usage rules, etc. Of course, this depends on your business. You may need more tables, related products, related users...