def mpart_atts= atts
atts.each do |att|
if !att[:part].blank? and att[:id].blank?
mparts.build(att)
elsif !att[:part].blank? and !att[:id].blank?
item = mparts.detect{|i| i.id == att[:id].to_i}
item.attributes = att
end
end
end
mpart_atts=自定义product方法,与页面多端数组变量对应
mparts为数据库product对应多端