ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~[sql] CREATE TABLE `xi_order` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `dealer_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商家ID', `stores_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店ID', `member_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID', `referrer_id` int(11) unsigned DEFAULT '0' COMMENT '推荐人ID', `sn` varchar(32) NOT NULL DEFAULT '' COMMENT '订单唯一编码', `buyer_ip` varchar(16) NOT NULL DEFAULT '' COMMENT '购买者IP', `buyer_terminal` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '购买者终端,1=>PC,2=>WAP,3=>微信,4=>安卓,5=>IOS', `consignee` varchar(16) NOT NULL DEFAULT '' COMMENT '收货人姓名', `mobile` varchar(16) NOT NULL DEFAULT '' COMMENT '手机号码', `email` varchar(32) NOT NULL DEFAULT '' COMMENT '邮件', `country` varchar(16) NOT NULL DEFAULT '中国' COMMENT '国家', `province` varchar(16) NOT NULL DEFAULT '' COMMENT '省份', `city` varchar(16) NOT NULL DEFAULT '' COMMENT '城市', `district` varchar(16) NOT NULL DEFAULT '' COMMENT '县区', `twon` varchar(16) NOT NULL DEFAULT '' COMMENT '乡镇', `address` varchar(64) NOT NULL DEFAULT '' COMMENT '详细地址', `zipcode` varchar(8) NOT NULL COMMENT '邮政编码', `longitude` varchar(16) NOT NULL DEFAULT '' COMMENT '经度', `latitude` varchar(16) NOT NULL DEFAULT '' COMMENT '纬度', `delivery_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '配送方式,1=>快递,2=>配送员送货,3=>自取', `delivery_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '配送价格', `express_name` varchar(16) NOT NULL DEFAULT '' COMMENT '快递名称', `express_shipper_code` varchar(16) NOT NULL DEFAULT '' COMMENT '快递公司编码', `express_code` varchar(16) NOT NULL DEFAULT '' COMMENT '快递编码', `express_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '快递价格', `express_remark` varchar(64) NOT NULL DEFAULT '' COMMENT '快递备注', `other_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '其他价格', `other_price_remark` varchar(32) NOT NULL DEFAULT '' COMMENT '其他价格备注', `full_subtract_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '满减抵扣', `redpacket_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '红包抵扣', `coupon_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券抵扣', `seconds_kill_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '秒杀抵扣', `point_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '积分抵扣', `balance_deduction` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '余额抵扣', `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实付金额', `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单总价(含运费及优惠抵扣,不含余额抵扣)', `member_remark` varchar(128) NOT NULL DEFAULT '' COMMENT '会员备注', `remark` varchar(128) NOT NULL DEFAULT '' COMMENT '商家备注', `pay_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付类型,1=>余额,2=>微信公众号,3=>微信APP,4=>微信H5,5=>微信扫码,6=>支付宝', `pay_code` varchar(64) NOT NULL DEFAULT '' COMMENT '支付编码(余额支付为钱包记录的ID)', `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `is_cancel` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否取消,0=>未取消,1=>已取消', `is_payment` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否支付,0=>未支付,1=>已支付', `is_deliver` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否发货,0=>未发货,1=>已发货', `is_receiving` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否收货,0=>未收货,1=>已收货', `is_complete` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否完成,0=>未完成,1=>已完成', `is_evaluate` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否评价,0=>未评价,1=>已评价,2=>已追评', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', `cancel_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '取消时间', `payment_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '支付时间', `deliver_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '发货时间', `receiving_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '收货时间', `complete_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '完成时间', `evaluate_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '评价时间', PRIMARY KEY (`id`), UNIQUE KEY `sn` (`sn`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='订单'; ~~~ ~~~[sql] CREATE TABLE `xi_order_goods` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID', `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID', `cate_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID', `brands_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '品牌ID', `express_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '快递ID', `template_id` int(11) unsigned DEFAULT NULL COMMENT '模板ID', `sn` varchar(32) NOT NULL DEFAULT '' COMMENT '商品唯一编码', `name` varchar(64) NOT NULL DEFAULT '' COMMENT '名称', `weight` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '重量(kg)', `volume` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '体积(cm³)', `thumb` varchar(255) NOT NULL DEFAULT 'http://oss.dgyouduo.com/static/img/no-image.png' COMMENT '缩略图', `banner` varchar(512) NOT NULL DEFAULT 'a:1:{i:0;s:53:"http://oss.dgyouduo.com/static/img/no-image-16x10.png";}' COMMENT '横幅(轮播图)', `summary` varchar(128) NOT NULL DEFAULT '' COMMENT '摘要', `content` text NOT NULL COMMENT '内容', `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '普通价格', `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价格', `inventory` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '库存', `view_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '浏览数', `sale_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '销售数', `sku_key` varchar(32) DEFAULT NULL COMMENT '存放SKU库存量项目ID进行拼接', `number` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买数量', `is_free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否包邮', `is_hot` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否推荐', `is_new` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否新品', `is_real` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否实体商品', `is_sale` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否上架', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '商品创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '商品编辑时间', `saled_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '商品上架时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='订单商品'; ~~~ ~~~[sql] CREATE TABLE `xi_order_log` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID', `operator` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID', `operate` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '操作,1=>会员下单,2=>会员支付,3=>商家发货,4=>会员确认收货,5=>商家完成订单,6=>平台完成订单,7=>系统完成订单,8=>会员评价订单,9=>会员取消订单,10=>配送员接单,11=>配送员取货,12=>配送员完成订单', `remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='订单日志'; ~~~