feat(pay): card-pass redeem for VIP and balance (zibll-style)
Rewrite charge-card into typed single-use card_pass inventory with public redeem REST, user-center UI for balance/VIP, admin type-aware create/batch, and CAS mark-used fulfillment via Credits/activate_vip.
This commit is contained in:
1 parent
5d7b138c2c
commit
d34c954b83
14 files changed
+936
-132
No files matched your search
@@ -348,22 +348,29 @@ trait AKSRT_DB_Migrator_Part_2 {
|
||||
) {$charset_collate};";
|
||||
dbDelta($sql_shipping);
|
||||
|
||||
// ── charge_card ──
|
||||
// ── charge_card (zibll-style typed card_pass) ──
|
||||
$sql_charge_card = "CREATE TABLE {$prefix}aksrt_charge_card (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
code VARCHAR(60) NOT NULL DEFAULT '',
|
||||
card VARCHAR(60) NOT NULL DEFAULT '',
|
||||
password VARCHAR(80) NOT NULL DEFAULT '',
|
||||
type VARCHAR(20) NOT NULL DEFAULT 'balance',
|
||||
amount DECIMAL(10,2) NOT NULL DEFAULT 0,
|
||||
balance DECIMAL(10,2) NOT NULL DEFAULT 0,
|
||||
status VARCHAR(20) NOT NULL DEFAULT 'active',
|
||||
meta LONGTEXT DEFAULT NULL,
|
||||
order_number VARCHAR(32) NOT NULL DEFAULT '',
|
||||
used_by BIGINT UNSIGNED DEFAULT NULL,
|
||||
used_at DATETIME DEFAULT NULL,
|
||||
expires_at DATETIME DEFAULT NULL,
|
||||
created_at DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
note TEXT DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY idx_code (code),
|
||||
UNIQUE KEY idx_password (password),
|
||||
KEY idx_card (card),
|
||||
KEY idx_type (type),
|
||||
KEY idx_status (status),
|
||||
KEY idx_used_by (used_by),
|
||||
KEY idx_order_number (order_number),
|
||||
KEY idx_expires (expires_at)
|
||||
) {$charset_collate};";
|
||||
dbDelta($sql_charge_card);
|
||||
|
||||
Reference in new issue
Block a user