积分商城SQL表设计

--用户表
create table Mall_Member
(
	Id int not null primary key identity(1,1),--自增ID主键
	Mobile varchar(20) null,--手机号码
	LoginUsName varchar(20) null,--登录名称
	LoginPassword varchar(32) null,--登录密码
	Email varchar(20) null,--邮箱
	NickName nvarchar(10) null,--昵称
	headPortrait varchar(150) null,--头像url
	RegTime datetime not null,--注册时间
	ShopAddressId int null--默认收货地址id
)
go

--收货地址表
create table Mall_MemberShoppingAddress
(
	Id int not null primary key identity(1,1),--自增ID主键
	Province nvarchar(20) null,--省
	City nvarchar(20) null,--市
	CityArea nvarchar(20) null,--区
	DetailedAddress nvarchar(60) null,--详细地址
	contacts nvarchar(20) null,--联系人
	Mobile varchar(20) null,--手机号码
	CreateDateTime datetime null--创建时间
)
go

--积分表
create table Mall_Credits
(
	Id int not null primary key identity(1,1),--自增ID主键
	UserId int not null,--用户ID
	UserCredit int not null,--积分
	Remarks nvarchar(20) null--备注
)
go
--积分明细表
create table Mall_CreditsDetailed
(
	Id int not null primary key identity(1,1),--自增ID主键
	UserId int not null,--用户ID
	CreditsState int not null,--积分状态 1、消费积分 2、添加积分
	CreditsDT datetime not null,--积分时间
	CreditsContent nvarchar(50) null,--积分内容
	CreditsValue int not null,--积分值
	Remarks nvarchar(20) null--备注
)
go
--积分兑换表
create table Mall_CreditExchange
(
	Id int not null primary key identity(1,1),--自增ID主键
	UserId int not null,--用户ID
	ExchangedCredit int not null,--兑换的积分
	ProductId int not null,--兑换的商品id
	CreateDateTime datetime not null--兑换时间
)
go
--发货申请表
create table Mall_logistics
(
	Id int not null primary key identity(1,1),--自增ID主键
	TypeId int not null,--发货类型,1:购买,2:积分兑换
	CreditExchangeId int not null,--积分兑换表(积分兑换Id)
	ProductId int not null,--要发货的商品id
	CreateDateTime datetime not null,--申请时间
	ExpressNo varchar(200) null--物流单号
)

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值