20260730_mall_refund_apply.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132
  1. -- 商城顾客自助售后申请表
  2. -- 用途:mallApp 顾客提交售后申请(待审核),商家在 hdApp 人工通过/驳回后再执行资金退款
  3. -- 执行前请确认线上库无同名表
  4. CREATE TABLE IF NOT EXISTS `xhMallRefundApply` (
  5. `id` int(11) NOT NULL AUTO_INCREMENT,
  6. `mainId` int(11) NOT NULL DEFAULT 0 COMMENT '中央id',
  7. `shopId` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
  8. `hdId` int(11) NOT NULL DEFAULT 0 COMMENT '花店客户id(xhHd)',
  9. `customId` int(11) NOT NULL DEFAULT 0 COMMENT '客户id(xhCustom)',
  10. `userId` int(11) NOT NULL DEFAULT 0 COMMENT '商城用户id',
  11. `orderId` int(11) NOT NULL DEFAULT 0 COMMENT '零售订单id(xhOrder)',
  12. `orderSn` varchar(64) NOT NULL DEFAULT '' COMMENT '零售订单号',
  13. `refundType` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1退货并退款 2仅退款',
  14. `product` text COMMENT '勾选商品/花材JSON快照',
  15. `refundPrice` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT '申请退款金额',
  16. `remark` varchar(500) NOT NULL DEFAULT '' COMMENT '顾客备注',
  17. `hbId` int(11) NOT NULL DEFAULT 0 COMMENT '下单红包id快照',
  18. `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0待审核 1已通过 2已驳回 3已取消',
  19. `rejectReason` varchar(255) NOT NULL DEFAULT '' COMMENT '驳回原因',
  20. `auditAdminId` int(11) NOT NULL DEFAULT 0 COMMENT '审核人id',
  21. `auditAdminName` varchar(64) NOT NULL DEFAULT '' COMMENT '审核人姓名',
  22. `auditTime` datetime DEFAULT NULL COMMENT '审核时间',
  23. `hdRefundId` int(11) NOT NULL DEFAULT 0 COMMENT '通过后关联xhHdRefund.id',
  24. `addTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间',
  25. `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  26. PRIMARY KEY (`id`),
  27. KEY `idx_orderId` (`orderId`),
  28. KEY `idx_shop_status` (`shopId`,`status`),
  29. KEY `idx_customId` (`customId`),
  30. KEY `idx_userId` (`userId`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商城顾客售后申请';