多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
#### 规格列表 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&met=lists&typ=json int:page#页数 int:rows=100#每页记录数 <<< success { "cmd_id":-140, "status":200, "msg":"success", "data": {"page":1, "total":1, "totalsize":"1", "records":"1", "items":[ {"spec_id":"1", //规格id "spec_name":"颜色", //规格名称 "cat_id":"0", //快捷定位 "spec_displayorder":"40",//排序 "spec_readonly":"1", //不可删除 "id":"1" }]}} <<< error ~~~ #### 新增规格 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&typ=json&met=addGoodsSpec string:spec_name#规格名称 int:spec_displayorder#排序 <<< success {"cmd_id":-140, "status":200, "msg":"success", "data":{ "spec_name":"分量", //规格名称 "spec_displayorder":10, //排序 "id":60, "spec_id":60 //规格id }} <<< error ~~~ #### 编辑规格 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&typ=json&met=editGoodsSpec int:spec_id#规格id string:spec_name#规格名称 int:spec_displayorder#排序 <<< #### success {"cmd_id":-140, "status":200, "msg":"success", "data":{ "spec_name":"分量", //规格名称 "spec_displayorder":10, //排序 "id":60, "spec_id":60 //规格id }} <<< error ~~~ #### 删除规格 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&met=remove&typ=json int:spec_id#规格id <<< success {"cmd_id":-140,"status":200,"msg":"success","data":{"spec_id":[60]}} <<< error ~~~ #### 新增/编辑规格值 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&met=saveSpecValue&typ=json *int:shop_id#店铺id row:old#原有的规格值 row:new#新增规格值,批量增加规格值 int:spec_id#规格id string:name#新增规格值名称,单个新增规格值 string:position#单个更新规格值时传值为storeAddGoods,批量不传值 int:cat_id#分类id <<< success {"cmd_id":-140, "status":200, "msg":"success", "data":[ {"cat_id":4, //分类id "shop_id":"1", //店铺id "spec_value_displayorder":"5", //排序 "spec_value_name":"白皮", //规格值名称 "spec_id":3, //规格id "spec_value_id":12 //规格值id } ]} <<< error {"cmd_id":-140,"status":250,"msg":"failure","data":{}} ~~~ ``` $old = Array ( [6] => Array //6为规格值id ( [displayorder] => 1 //排序 [spec_value_name] => 白皮 //规格值名称 ) [8] => Array ( [displayorder] => 2 [spec_value_name] => 红皮 ) ) $new = Array ( [0] => Array ( [displayorder] => 3 //排序 [spec_value_name] => 青皮 //规格值名称 ) ) ``` #### 删除规格值 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&met=removeSpecValue&typ=json *int:spec_value_id#规格值id <<< success {"cmd_id":-140,"status":200,"msg":"success","data":{}} <<< error {"cmd_id":-140,"status":250,"msg":"failure","data":{}} ~~~ #### 规格值列表 ~~~[api] get:/index.php?ctl=Api_Goods_Spec&met=getSpecValue&typ=json *spec_id#规格id *cat_id#分类id <<< success {"cmd_id":-140, "status":200, "msg":"success", "data":{ "8":{ "spec_value_id":"8", //规格值id "spec_value_name":"白皮", //规格值名称 "spec_id":"3", //规格id "type_id":"0", "cat_id":"0", //分类id "shop_id":"1", //店铺id "spec_value_displayorder":"2", //排序 "id":"8" }, "6":{ "spec_value_id":"6", "spec_value_name":"黑皮", "spec_id":"3", "type_id":"0", "cat_id":"0", "shop_id":"1", "spec_value_displayorder":"1", "id":"6" } }} <<< error ~~~