---
title: "几百类商品，每类商品有不同的属性，定义不同的字段，设计数据库"
author: "scholltop"
date: "2013-11-19T10:42:04Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2013-11-19T10:42:04Z"
id: 1976805
url: "https://schooltop.iteye.com/blog/1976805"
---

需求需要将、餐饮；spa养生；酒店住宿；租车；订机票  等等功能作为产品来供用户选择。

因此会遇到，几百类商品，每类商品有不同的属性，定义不同的字段，这个问题。


解决方案现在是这样做的。


service_styles  服务类型  （餐饮；spa养生；酒店住宿；租车；订机票）


service   服务种类         （服务类型的细化）


product   产品             （具体服务）   service_id , mterria_model(如CAT) ,mterria_id (cats类中的id)



cats ;  spas  ;hotel ; foods  各具体产品属性表。
