Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、e コマース Web サイトにクーポン コード検証オプションを実装しています。定額またはパーセンテージの 2 種類のクーポンがあります。バックエンドでこれらの両方に取り組む方法。データベーススキーマで意味します。
CREATE TABLE IF NOT EXISTS `coupon` ( `code` varchar(20) NOT NULL, `type` varchar(10) NOT NULL, `amount` float NOT NULL, UNIQUE KEY `code` (`code`) );
簡単な例...