商品表字段
```
`goods_id` int(11) : '商品id',
`cate_id` int(11) : '分类id',
`shop_id` int(11) : '店铺id',
`goods_name` varchar(50) : '商品名称',
`goods_price` decimal(5,1) : '商品价格',
`goods_stock` int(11) : '商品库存',
`goods_about` varchar(100) : '商品描述',
`goods_account` varchar(100) : '商品使用说明',
`stock_type` int(2) : '减库存方式:0未支付,1已支付',
`camilo_type` int(2) : '卡密类型:1标准卡2循环卡',
`camilo_show` varchar(50) : '卡密展示字段',
`is_play` int(2) : '商品状态:0下架1上架',
`sell_num` int(11) : '卖出数量',
`update_time` datetime : '更新时间',
`create_time` datetime : '创建时间'
```
1.商品创建
~~~[api]
post:http://test.qingdabao.com/goods/goods_create
cate_id=1#分类id
shop_id=1#店铺id
goods_name#商品名称
goods_price#商品价格
goods_about#商品描述
goods_account#商品使用说明
stock_type#减库存方式:0点击未支付,1已支付
camilo_type#卡密类型:1标准卡2循环卡
camilo_show#卡密展示字段
is_play#商品上下架:0下架1上架
<<<
success
success
<<<
error
error
~~~
2.商品信息查询
~~~[api]
get:http://test.qingdabao.com/goods/goods_find
goods_id=1#商品id
<<<
success
{
"status": 0,
"message": "ok",
"data": {
"goods_id": 1,
"cate_id": 1,
"shop_id": 1,
"goods_name": "爱奇艺会员",
"goods_price": "15.0",
"goods_stock": 50,
"goods_about": "爱奇艺会员一月充值卡",
"goods_account": "不能转让,只能使用一次",
"stock_type": 1,
"camilo_type": 1,
"camilo_show": "account,password,pay_time,order_id",
"is_play": 1,
"camilo_num": 0,
"sell_num": 0,
"update_time": "2020-04-01 16:57:09",
"create_time": "2020-04-01 15:17:39"
}
}
<<<
error
error
~~~
3.商品编辑
禁止修改字段['goods_id'=>'******','shop_id'=>'******','is_play'=>'******','camilo_num'=>'******','sell_num'=>'******','update_time'=>'******','create_time'=>'******'];
~~~[api]
put:http://test.qingdabao.com/goods/goods_edit
goods_id=1#商品id
array#一维数组:需要编辑的字段
<<<
success
success
<<<
error
error
~~~
4.商品删除
~~~[api]
delete:http://test.qingdabao.com/goods/goods_del
goods_id=1#商品id
<<<
success
success
<<<
error
error
~~~
5.商品上下架
~~~[api]
put:http://test.qingdabao.com/goods/goods_display
goods_id=1#商品id
type#两种情况:0=>下架,1=>上架
<<<
success
success
<<<
error
error
~~~
6.商品列表
查询字段['shop_id'=>'**','cate_id'=>'**','is_play'=>'**']
shop_id不能为空,必须有初始值
search:
~~~[api]
post:http://test.qingdabao.com/goods/goods_list
page=1#页码(第几页)
type#两种情况:1=>没有搜说词,2有搜索词
array#查询条件,一维数组
search#搜索关键词,可选,对应type=2
<<<
success
success
<<<
error
error
~~~
7.下拉商品
~~~[api]
get:http://test.qingdabao.com/goods/goods_down_list
shop_id#店铺id
cate_id#分类id
<<<
success
{
"status": 0,
"message": "ok",
"data": [
{
"goods_id": 1,
"cate_id": 1,
"shop_id": 1,
"goods_name": "爱奇艺会员",
"goods_price": "15.0",
"goods_stock": 50,
"goods_about": "爱奇艺会员一月充值卡",
"goods_account": "不能转让,只能使用一次",
"stock_type": 1,
"camilo_type": 1,
"camilo_show": "account,password,pay_time,order_id",
"is_play": 1,
"camilo_num": 0,
"sell_num": 0,
"update_time": "2020-04-01 16:57:09",
"create_time": "2020-04-01 15:17:39"
}
]
}
<<<
error
error
~~~