schooldb库——utf8字符集——utf8_general_ci排序规则
先创建库,再去使用下列的DDL语句。
DDL
CREATE TABLE `order_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`orderID` int(11) NOT NULL COMMENT '订单id',
`goodsId` int(11) NOT NULL COMMENT '商品id',
`goodsNum` int(11) NOT NULL DEFAULT '0' COMMENT '商品数量',
`goodsPrice` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '商品价格',
`goodsSpecId` int(11) DEFAULT '0' COMMENT '商品-规格ID',
`goodsSpecNames` varchar(500) DEFAULT NULL COMMENT '商品-规格值列表',
`goodsName` varchar(200) NOT NULL COMMENT '商品名称',
`goodsimg` varchar(150) NOT NULL COMMENT '商品图',
`commissionRate` decimal(11,2) DEFAULT '0.00' COMMENT '商品佣金比率',
`extraJson` text COMMENT '额外信息(目前用来穿越存放虚拟商品的卡券号)',
`goods Type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '商品类型(0:实物商品 1:虚拟商品)',
`commmission` decimal(11,2) DEFAULT '0.00' COMMENT '分销佣金',
`goodsCode` varchar(20) DEFAULT NULL COMMENT '商品标记(gift:赠品)',
`promotionJson` text COMMENT '商品是参与的优惠活动json记录',
`couponVal` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '优惠券减免金额',
`rewardVal` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '满减减免金额',
`useScoreVal` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品使用的积分',
`scoreMoney` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '积分抵扣金额',
`getScoreVal` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '购买该商品获得的积分',
`getScoreMoney` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '获得的积分可折扣的金额',
`orderGoodscommission` decimal(11,2) DEFAULT '0.00' COMMENT '订单商品佣金',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='王坤宇 订单商品表';
CREATE TABLE `order_refunds` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
` orderID` int(11) NOT NULL COMMENT '订单id',
`retundTo` int(11) NOT NULL DEFAULT '0' COMMENT '接收退款用户',
`refundReson` int(11) NOT NULL DEFAULT '0' COMMENT '用户申请退款原因id',
`refundOtheerReson` varchar(255) DEFAULT NULL COMMENT '用户申请退款原因',
`backMoney` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '用户退款金额',
`refundTradeNo` varchar(100) DEFAULT NULL COMMENT '管理员退款流水号',
`refunRemark` varchar(500) NOT NULL COMMENT '退款备注',
`refundTime` datetime NOT NULL COMMENT '退款时间',
`shopRejectReason` varchar(255) DEFAULT NULL COMMENT '店铺不同意拒收原因',
`refundStatus` tinyint(4) NOT NULL DEFAULT '0' COMMENT '退款状态(-1:商家不同意 0:等待商家处理 1:商家同意 2:管理员已处理)',
`create Time` datetime NOT NULL COMMENT '用户退款时间',
`serviceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '售后单id',
`isServiceRefund` int(4) unsigned NOT NULL DEFAULT '0' COMMENT '售后单是否已退款(1:已退款 0:未退款)',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='王坤宇 订单退款记录表';
CREATE TABLE `order_services` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`orderId` int(10) unsigned NOT NULL COMMENT '订单id',
`goodsServiceTypee` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '售后类型(1:退款0;退款退货 2:换货)',
`servuceType` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '退换类型(数据由基础数据类型里取)',
`serviceRemark` varchar(600) DEFAULT NULL COMMENT '退换原因',
`serviceAnnex` text COMMENT '附件',
`refundScore` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '本次申请可退还的积分,用系统计算得出',
`useerScoreMoney` decimal(11,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '使用积分可抵扣金额',
`getScoreMoney` decimal(11,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '获得的积分可抵扣金额',
`refunfMoney` decimal(11,2) DEFAULT NULL COMMENT '申请退款的金额',
`refundableMoney` decimal(11,2) DEFAULT NULL COMMENT '售后单可退款金额',
`isShopAgree` tinyint(4) DEFAULT '0' COMMENT '店铺是否同意(1:同意0;不同意)',
`disagreeRemark` varchar(600) DEFAULT NULL COMMENT '店铺不同意原因',
`userAddressId` int(11) unsigned DEFAULT '0' COMMENT '用户收货地址id',
`areaId` int(11) unsigned DEFAULT '0' COMMENT '地区id',
`arealdPath` varchar(255) DEFAULT NULL COMMENT '地区id值列表',
`userName` varchar(200) DEFAULT NULL COMMENT '用户收货人',
`userAddress` varchar(200) DEFAULT NULL COMMENT '用户详细收货地址',
`userPhone` varchar(200) DEFAULT NULL COMMENT '用户收货电话',
`shopAreaId` int(11) unsigned DEFAULT '0' COMMENT '数据收货地区id',
`shopAreaIddPath` varchar(255) DEFAULT NULL COMMENT '商家收货地区id值列表',
`shoopAdddress` varchar(200) DEFAULT NULL COMMENT '商家详细收货地址',
`shoopPhone` varchar(200) DEFAULT NULL COMMENT '商家收货电话',
`isUserSSendGoods` tinyint(4) DEFAULT '0' COMMENT '用户是否发货(0:未发货 1:已发货)',
`express Type` tinyint(4) DEFAULT '0' COMMENT '用户是否使用物流(0:无需物流 1:物流)',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='王坤宇 售后申请表';