# 商品类型
#### 类型列表
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Type&met=lists&typ=json
int:page=1#页数
int:rows#每页记录数
<<<
success
{
"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"page":1,
"total":36,
"totalsize":"36",
"records":"36",
"items":[{
"type_id":"161",
"type_name":"德玛西亚", //类型名称
"type_displayorder":"0", //排序
"cat_id":"-1", //仅仅定位,无用
"cat_name":"",
"type_draft":"0", //草稿:只允许存在一条记录
"id":"161"
}]}}
<<<
error
```
```
#### 新增类型
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Type&typ=json&met=addType
string:type_name#类型名称
int:type_displayorder#排序
row:type_brand#类型相关联品牌
row:type_spec#类型相关联规格
row:type_property#类型相关联属性
<<<
success
{
"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"type_name":"男装", //类型名称
"type_displayorder":1, //排序
"type_draft":0, //草稿:只允许存在一条记录
"type_id":"162" //类型id
}}
<<<
error
```
```
```
<pre class="calibre14">```
$type_brand<span class="token">=</span>Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span> <span class="token5">//品牌id</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">3</span>
<span class="token1">)</span>
$type_spec<span class="token">=</span>Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">6</span> <span class="token5">//规格id</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">59</span>
<span class="token1">)</span>
```
```
#### 编辑类型
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Type&typ=json&met=editType
int:id#类型id
string:type_name#类型名称
int:type_displayorder#排序
row:type_brand#类型相关联品牌
row:type_spec#类型相关联规格
row:type_property#类型相关联属性
<<<
success
{
"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"type_name":"男装", //类型名称
"type_displayorder":1 //排序
}}
<<<
error
```
```
```
<pre class="calibre14">```
$type_brand<span class="token">=</span>Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span> <span class="token5">//品牌id</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">3</span>
<span class="token1">)</span>
$type_spec <span class="token">=</span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span> <span class="token5">//规格id</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">6</span>
<span class="token1">)</span>
type_property <span class="token">=</span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">126</span> <span class="token5">//商品属性</span>
<span class="token1">[</span>property_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 德玛 <span class="token5">//属性名称 </span>
<span class="token1">[</span>type_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">161</span> <span class="token5">//所属类型id</span>
<span class="token1">[</span>property_item<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">11</span> <span class="token5">//属性值列</span>
<span class="token1">[</span>property_is_search<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">0</span> <span class="token5">//是否被搜索。0为不搜索、1为搜索</span>
<span class="token1">[</span>property_format<span class="token1">]</span> <span class="token">=</span><span class="token">></span> select <span class="token5">//显示类型</span>
<span class="token1">[</span>property_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span> <span class="token5">//排序</span>
<span class="token1">[</span>id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">126</span>
<span class="token1">[</span>property_values<span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">179</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token5">//属性值id</span>
<span class="token1">(</span>
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">179</span> <span class="token5">//属性值id</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">11</span> <span class="token5">//属性值名称</span>
<span class="token1">[</span>property_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">126</span> <span class="token5">//所属属性id</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span> <span class="token5">//属性值排序</span>
<span class="token1">[</span>id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">179</span>
<span class="token1">)</span>
<span class="token1">)</span>
<span class="token1">)</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">127</span>
<span class="token1">[</span>property_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 德玛西亚
<span class="token1">[</span>type_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">161</span>
<span class="token1">[</span>property_item<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">12</span><span class="token1">,</span><span class="token6">12</span>
<span class="token1">[</span>property_is_search<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span>
<span class="token1">[</span>property_format<span class="token1">]</span> <span class="token">=</span><span class="token">></span> select
<span class="token1">[</span>property_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span>
<span class="token1">[</span>id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">127</span>
<span class="token1">[</span>property_values<span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">180</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">180</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">12</span>
<span class="token1">[</span>property_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">127</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span>
<span class="token1">[</span>id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">180</span>
<span class="token1">)</span>
<span class="token1">[</span><span class="token6">181</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">181</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">12</span>
<span class="token1">[</span>property_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">127</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span>
<span class="token1">[</span>id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">181</span>
<span class="token1">)</span>
<span class="token1">)</span>
<span class="token1">)</span>
<span class="token1">)</span>
```
```
#### 删除类型
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Type&met=remove&typ=json
int:type_id#类型id
<<<
success
{"cmd_id":-140,"status":200,"msg":"success","data":{"type_id":[162]}}
<<<
error
```
```
#### 新增类型属性
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Property&met=addProperty&typ=json
int:type_id#类型id
string:property_format#显示类型 select
int:property_is_search#是否被搜索 0不搜索 1搜索
string:property_name#属性名称
int:property_displayorder#排序
row:property_rows#属性值
<<<
success
{"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"type_id":1,
"property_format":"select",
"property_is_search":1,
"property_name":"虾皮颜色",
"property_displayorder":1,
"property_item":"白皮,红皮",
"property_id":3,
"id":3
}}
<<<
error
```
```
```
<pre class="calibre14">```
property_rows<span class="token">=</span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span> <span class="token5">//排序</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 白皮 <span class="token5">//属性值名称</span>
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">0</span> <span class="token5">//新增属性,默认为0</span>
<span class="token1">)</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 红皮
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">0</span>
<span class="token1">)</span>
)
```
```
#### 修改类型属性
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Goods_Property&met=editProperty&typ=json
int:property_id#属性id
string:property_name#属性名称
int:property_displayorder#排序
int:property_is_search#是否被搜索 0不搜索 1搜索
string:property_format#显示类型
row:property_rows#属性值
name#说明文字
<<<
success
{"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"property_is_search":1, //是否被搜索
"property_name":"虾皮颜色", //属性名称
"property_format":"select", //显示类型
"property_displayorder":1, //排序
"property_item":"白皮,红皮", //属性值列
"property_id":3, //属性id
"id":3
}}
<<<
error
```
```
```
<pre class="calibre14">```
property_rows<span class="token">=</span> Array
<span class="token1">(</span>
<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span> <span class="token5">//排序</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 白皮 <span class="token5">//属性值名称</span>
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">3</span>
<span class="token1">)</span>
<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token1">(</span>
<span class="token1">[</span>property_value_displayorder<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span>
<span class="token1">[</span>property_value_name<span class="token1">]</span> <span class="token">=</span><span class="token">></span> 红皮
<span class="token1">[</span>property_value_id<span class="token1">]</span> <span class="token">=</span><span class="token">></span> <span class="token6">4</span>
<span class="token1">)</span>
)
```
```
#### 删除类型属性
```
<pre class="calibre15">```
get:/index.php?ctl=Api_Goods_Property&met=remove&typ=json
*int:id#属性id
<<<
success
{"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"id":4 //属性id
}}
<<<
error
```
```
- 序言
- 系统要求
- 版本更新日志
- 远丰商城技术对接说明
- 开发指导
- 框架内容
- 基础
- 开发规范
- 目录结构
- 架构
- 架构总览
- 数据库
- 数据库连接
- 基本使用
- 缓存
- 配置
- 路由
- 数据字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- 通讯内容
- 商家中心
- 顶部导航栏
- 店铺信息栏
- 店铺及商品提示栏
- 交易提示栏
- 销售情况统计栏
- 单品销量排行栏
- 店铺运营推广栏
- 平台联系方式栏
- 订单物流
- 商品
- 商品列表
- 商品详情
- 商品发布与编辑
- 分销商品
- 关联版式
- 商品规格
- 图片空间
- 淘宝导入
- 订单流程
- 交易订单
- 订单退款/退货
- 促销
- 团购管理
- 加价购
- 限时折扣
- 满即送
- 代金券管理
- 分销
- 店铺
- 店铺设置
- 自销产品供应商
- 实体店铺
- 品牌申请
- 店铺信息
- 消费者保障服务
- 门店账号
- 分销商--产品供应商
- 分销明细
- 批发市场
- 售后服务
- 咨询管理
- 投诉管理
- 退款管理
- 退货管理
- 云方案架构
- 负载集群
- 云存储
- 接口
- Api接口说明
- 品牌
- 商品规格
- 商品类型
- 商品分类
- 商品
- 订单
- 商品/店铺收藏
- 足迹
- 退款及退货
- 商家店铺
- 会员
- 入驻协议
- 订单接口
- 商品接口
- 订单物流接口
- 商家中心接口
- 促销接口
- 快递鸟物流接口
- 代金券接口
- 首页版块
- 团购
- 平台红包
- 限时折扣接口
- 拼团接口
- wap首页模板
- 杂项
- 远程上传图片
- JS
- 银联支付
- 多语言
- 商品评分
- 图片加载
- 买家申请退款退货
- 商家退款退货
- 平台退款退货
- 添加发票
- 提交订单
- 确认订单
- 运费销售区域
- 获取会员地址
- 充值
- 导出XLS
- 商城系统集成
- 多语言实现
- 三级分销推广链接发展推广员
- app.ini.php
- 去分销
- 版本更新
- 物流支持
- 运营人员建议
- 业务逻辑
- 统计结算
- 客服消息
- 账号
- 三级分销
- IM
- 配置
- 平台帐号
- 活动数据表说明