新增订单待支付与支付确认后端流程
This commit is contained in:
@@ -57,6 +57,7 @@ CREATE TABLE rental_listings (
|
||||
price_daily DECIMAL(12,2) NOT NULL DEFAULT 0.00,
|
||||
price_weekly DECIMAL(12,2) NOT NULL DEFAULT 0.00,
|
||||
deposit_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
|
||||
in_transaction TINYINT(1) NOT NULL DEFAULT 0,
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'draft',
|
||||
review_status VARCHAR(32) NOT NULL DEFAULT 'none',
|
||||
review_reason VARCHAR(255) NOT NULL DEFAULT '',
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
SET @listing_in_transaction_exists := (
|
||||
SELECT COUNT(*)
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'rental_listings'
|
||||
AND column_name = 'in_transaction'
|
||||
);
|
||||
|
||||
SET @add_listing_in_transaction_sql := IF(
|
||||
@listing_in_transaction_exists = 0,
|
||||
'ALTER TABLE rental_listings ADD COLUMN in_transaction TINYINT(1) NOT NULL DEFAULT 0 AFTER deposit_amount',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE add_listing_in_transaction_stmt FROM @add_listing_in_transaction_sql;
|
||||
EXECUTE add_listing_in_transaction_stmt;
|
||||
DEALLOCATE PREPARE add_listing_in_transaction_stmt;
|
||||
|
||||
INSERT INTO system_configs (`key`, `value`, description)
|
||||
VALUES ('order.pending_payment_timeout_minutes', '15', '订单待支付超时取消分钟数')
|
||||
ON DUPLICATE KEY UPDATE `key` = VALUES(`key`);
|
||||
Reference in New Issue
Block a user