CREATE TABLE `qimall_addons_atp_apply`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deal_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单号',
  `mall_id` int(11) NULL DEFAULT NULL,
  `alipay_app_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '支付宝应用ID',
  `company` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公司名称',
  `contacts` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '联系人',
  `phone` char(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '电话',
  `status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '1审核中 2审核成功 3审查失败 ',
  `is_delete` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否删除',
  `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '理由',
  `auth_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '授权url',
  `auth_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '1 授权中 2授权通过',
  `auth_time` int(11) NULL DEFAULT NULL COMMENT '授权时间',
  `auth_expires_time` int(11) NULL DEFAULT NULL COMMENT '授权过期时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `alipay_app_id`(`alipay_app_id`) USING BTREE,
  INDEX `company`(`company`) USING BTREE,
  INDEX `phone`(`phone`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '支付宝代付授权申请表' ROW_FORMAT = DYNAMIC;

CREATE TABLE `qimall_addons_atp_order`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NULL DEFAULT NULL,
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '批次号',
  `order_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号',
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1提现打款2手动转账',
  `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收款人账号',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收款人姓名',
  `money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '打款金额',
  `status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '1待打款2打款中3打款成功4打款失败5打款超时',
  `is_delete` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否删除',
  `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `source_id` int(11) NOT NULL DEFAULT 0 COMMENT '来源ID',
  `source_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来源单号',
  `form_html` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `msg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

