多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 商品类型 #### 类型列表 ``` <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 ``` ```