1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| DROP TABLE IF EXISTS `yoshop_order`; CREATE TABLE `yoshop_order` ( `order_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID', `order_no` varchar(20) NOT NULL DEFAULT '' COMMENT '订单号', `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品总金额(不含优惠折扣)', `order_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单金额(含优惠折扣)', `coupon_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券ID', `coupon_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券抵扣金额', `points_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '积分抵扣金额', `points_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分抵扣数量', `pay_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际付款金额(包含运费)', `update_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '后台修改的订单金额(差价)', `buyer_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '买家留言', `pay_type` tinyint(3) unsigned NOT NULL DEFAULT '20' COMMENT '支付方式(10余额支付 20微信支付)', `pay_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '付款状态(10未付款 20已付款)', `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '付款时间', `delivery_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '配送方式(10快递配送)', `express_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '运费金额', `express_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '物流公司ID', `express_company` varchar(50) NOT NULL DEFAULT '' COMMENT '物流公司', `express_no` varchar(50) NOT NULL DEFAULT '' COMMENT '物流单号', `delivery_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '发货状态(10未发货 20已发货)', `delivery_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发货时间', `receipt_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '收货状态(10未收货 20已收货)', `receipt_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收货时间', `order_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '订单状态(10进行中 20取消 21待取消 30已完成)', `points_bonus` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '赠送的积分数量', `is_settled` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '订单是否已结算(0未结算 1已结算)', `transaction_id` varchar(30) NOT NULL DEFAULT '' COMMENT '微信支付交易号', `is_comment` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已评价(0否 1是)', `order_source` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '订单来源(10普通订单)', `order_source_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '来源记录ID', `platform` varchar(20) NOT NULL DEFAULT '' COMMENT '来源客户端 (APP、H5、小程序等)', `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', `is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除', `store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID', `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`order_id`), UNIQUE KEY `order_no` (`order_no`) USING BTREE, KEY `store_id` (`store_id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='订单记录表';
|