Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

订单表如何设计

订单有数量,单价,总价
我想问一下总价计算后要不要存库。啥时计算


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

这类字段一般最好存库,因为单价有可能是会调整的 如果单价发生变化了,总价也会变,这样订单表就比较明了。并且做查询的时候可以直接查总价字段了,不用任何表达式。
在保存当前订单时 计算总价 并一起保存库中


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...