時間:2014年4月13日16:44:40 訂單入庫建表


訂單表設計:

訂單對應幾條商品:一對多:

訂單主鍵,訂單號,配送區域,詳細地址,郵編,收貨人姓名

電子郵件地址,電話,手機,標誌建築,最佳送貨時間

下單時間,訂單總金額,支付方式

create table orderinfo(

order_id int unsigned auto_increment  primary key,

order_sn char(15) not null default '',

user_id int unsigned not null default 0,

username varchar(20) not null default '',

zonevarchar(30) not null default '',

address varchar(30) not null default '',

zipcode char(6) not null default '',

reciver varchar(10) not null default '',

emailvarchar(40) not null default '',

telvarchar(20) not null default '',

mobile char(11) not null default '',

building varchar(30) not null default '',

best_time varchar(10) not null default  '',

add_time int unsigned not null default 0,

order_amount decimal(10,2) not null  default 0.0,

pay tinyint(1) not null default 0

) engine myisam charset utf8;


訂單商品表:

訂單商品主鍵

訂單主鍵

訂單號

訂單編號商品名商品編號商品數量商品價格小計


create table ordergoods(

og_id int unsigned auto_increment primary  key,

order_id int unsigned not null default 0,

order_sn char(15) not null default '',

goods_idint unsigned not null default 0,

goods_name varchar(60) not null default  '',

goods_number smallint not null default 1,

shop_price decimal(10,2) not null default  0.0,

subtotaldecimal(10,2) not null default 0.0

) engine myisam charset utf8;



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章