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

Categories

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

订单表如何设计

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


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

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...