已上

-- 商城顾客售后并入零售退款主表 xhHdRefund
-- 用途：顾客申请落待审核记录（status=0），商家审核通过后再走资金/库存
-- 执行前请确认 xhHdRefund 尚无 userId/hdId/product/rejectReason 字段

ALTER TABLE `xhHdRefund`
  MODIFY COLUMN `status` tinyint(2) unsigned NOT NULL DEFAULT 0 COMMENT '0待审核 1已通过 2已驳回 3已取消',
  ADD COLUMN `userId` int(11) NOT NULL DEFAULT 0 COMMENT '商城用户id，商家发起为0' AFTER `customId`,
  ADD COLUMN `hdId` int(11) NOT NULL DEFAULT 0 COMMENT '花店客户id(xhHd)' AFTER `userId`,
  ADD COLUMN `product` varchar(2000) NOT NULL DEFAULT '' COMMENT '待审核阶段勾选商品/花材JSON快照，通过后转 xhHdRefundItem/Goods' AFTER `refundType`,
  ADD COLUMN `rejectReason` varchar(255) NOT NULL DEFAULT '' COMMENT '驳回原因' AFTER `remark`,
  ADD KEY `idx_userId_status` (`userId`,`status`),
  ADD KEY `idx_shop_status` (`shopId`,`status`);

DROP TABLE IF EXISTS `xhMallRefundApply`;
