企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
![订单](https://box.kancloud.cn/19bbcc3e17ad298a49ca80b23be922bd_1412x725.png) ![订单相关表结构](https://box.kancloud.cn/95b6d80e9f6d45d61bacd4c02cf61123_1382x737.png) # 订单表 * * * * * ~~~ DROP TABLE IF EXISTS `shop_order`; CREATE TABLE IF NOT EXISTS `shop_order`( `orderid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `userid` BIGINT UNSIGNED NOT NULL DEFAULT '0', `addressid` BIGINT UNSIGNED NOT NULL DEFAULT '0', `amount` DECIMAL(10,2) NOT NULL DEFAULT '0.00', `status` INT UNSIGNED NOT NULL DEFAULT '0', `expressid` INT UNSIGNED NOT NULL DEFAULT '0', `expressno` VARCHAR(50) NOT NULL DEFAULT '', `createtime` INT UNSIGNED NOT NULL DEFAULT '0', `updatetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY shop_order_userid(`userid`), KEY shop_order_addressid(`addressid`), KEY shop_order_expressid(`expressid`) )ENGINE=InnoDB DEFAULT CHARSET='utf8'; ~~~ # 订单详情表 ***** ~~~ DROP TABLE IF EXISTS `shop_order_detail`; CREATE TABLE IF NOT EXISTS `shop_order_detail`( `detailid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `productid` BIGINT UNSIGNED NOT NULL DEFAULT '0', `price` DECIMAL(10,2) NOT NULL DEFAULT '0.00', `productnum` INT UNSIGNED NOT NULL DEFAULT '0', `orderid` BIGINT UNSIGNED NOT NULL DEFAULT '0', `createtime` INT UNSIGNED NOT NULL DEFAULT '0', KEY shop_order_detail_productid(`productid`), KEY shop_order_detail_orderid(`orderid`) )ENGINE=InnoDB DEFAULT CHARSET='utf8'; ~~~ # 收货地址表 * * * * * ~~~ DROP TABLE IF EXISTS `shop_address`; CREATE TABLE IF NOT EXISTS `shop_address`( `addressid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `firstname` VARCHAR(32) NOT NULL DEFAULT '', `lastname` VARCHAR(32) NOT NULL DEFAULT '', `company` VARCHAR(100) NOT NULL DEFAULT '', `address` TEXT, `postcode` CHAR(6) NOT NULL DEFAULT '', `email` VARCHAR(100) NOT NULL DEFAULT '', `telephone` VARCHAR(20) NOT NULL DEFAULT '', `userid` BIGINT UNSIGNED NOT NULL DEFAULT '0', `createtime` INT UNSIGNED NOT NULL DEFAULT '0', KEY shop_address_userid(`userid`) )ENGINE=InnoDB DEFAULT CHARSET='utf8'; ~~~