简要描述:

  • 商品评论接口

请求域名:

  • http://yunzshop.com

请求URL:

POST/app/index.php?i=1&c=entry&do=shop&m=yun_shop&route=goods.comment.get-comment

参数:

参数名 是否必须 类型 说明
goods_id int 商品ID
page int 页码数

返回示例:

正确时返回:

{
result: 1,
msg: "获取评论数据成功!",
data: {
total: 1,
per_page: 20,
current_page: 1,
last_page: 1,
next_page_url: null,
prev_page_url: null,
from: 1,
to: 1,
data: [
{
id: 42,
order_id: "73",
goods_id: "14",
uid: "7",
nick_name: "AAAAA",
head_img_url: "http://wx.qlogo.cn/mmopen/JkLDWNZN1WK7LWFt7jxGYjJEuF3wKAzgXiaG7Jr6qkCK6iae7Gr67yxhEGD3lPnBcuQlYQnwBCaCrpmcA36nwFTxvYyyR1ecHQ/132",
content: "我是主评论",
level: "4",
images: null,
created_at: "2017-04-17 17:26:11",
type: "1",
reply_count: 4,
append: {
id: 71,
uniacid: "6",
order_id: "73",
goods_id: "14",
uid: "7",
nick_name: "AAAAA",
head_img_url: "http://wx.qlogo.cn/mmopen/iaKtV2gsfVE8j9saYN6w7KEShgJ6OJsb2uyEvpx020vH7eYfC2poA5mo8Tmp4hGkbC65rb0uib38XXM0ia9qX6EtkgZia1JhkHqu/132",
content: "我是追加评论",
level: "4",
images: "a:0:{}",
comment_id: "42",
reply_id: "7",
reply_name: "AAAAA",
type: "3",
created_at: "2017-04-20 11:18:13",
updated_at: "2017-04-20 11:18:13",
deleted_at: null,
append: null
},
has_many_reply: [
{
id: 72,
uniacid: "6",
order_id: "73",
goods_id: "14",
uid: "146",
nick_name: "李一3天",
head_img_url: "http://wx.qlogo.cn/mmopen/iaKtV2gsfVE8j9saYN6w7KEShgJ6OJsb2uyEvpx020vH7eYfC2poA5mo8Tmp4hGkbC65rb0uib38XXM0ia9qX6EtkgZia1JhkHqu/132",
content: "李某回复主评论",
level: "4",
images: "a:0:{}",
comment_id: "42",
reply_id: "7",
reply_name: "AAAAA",
type: "2",
created_at: "2017-04-20 11:23:44",
updated_at: "2017-04-20 11:23:44",
deleted_at: null,
type_name: "回复"
},
{
id: 73,
uniacid: "6",
order_id: "73",
goods_id: "14",
uid: "0",
nick_name: "管理员",
head_img_url: "",
content: "管理员回复主评论",
level: "0",
images: "a:0:{}",
comment_id: "42",
reply_id: "7",
reply_name: "AAAAA",
type: "2",
created_at: "2017-04-20 11:24:09",
updated_at: null,
deleted_at: null,
type_name: "回复"
},
{
id: 75,
uniacid: "6",
order_id: "73",
goods_id: "14",
uid: "0",
nick_name: "管理员",
head_img_url: "",
content: "管理员回复李某",
level: "0",
images: "a:0:{}",
comment_id: "42",
reply_id: "146",
reply_name: "李一3天",
type: "2",
created_at: "2017-04-20 11:34:32",
updated_at: null,
deleted_at: null,
type_name: "回复"
},
{
id: 77,
uniacid: "6",
order_id: "73",
goods_id: "14",
uid: "0",
nick_name: "管理员",
head_img_url: "",
content: "1231231231231231",
level: "0",
images: "a:0:{}",
comment_id: "42",
reply_id: "146",
reply_name: "李一3天",
type: "2",
created_at: "2017-04-21 20:37:42",
updated_at: null,
deleted_at: null,
type_name: "回复"
}
]
}
]
}
}

错误时返回:

{
    "result":0,
    "msg":"未检测到评论数据!",
    "data":{
        "total":0,
        "per_page":10,
        "current_page":1,
        "last_page":0,
        "next_page_url":null,
        "prev_page_url":"http://test.ysv2.com/app/index.php?page=1",
        "from":null,
        "to":null,
        "data":[

        ]
    }
}

返回参数说明:

参数名 类型 说明
total int 分类总条数
per_page int 每页条数
current_page int 当前页码
last_page int 最后一页的页码 URL
next_page_url string 下一页URL
prev_page_url string 上一页URL
from int 第几条开始
to int 第几条结束
data json 评论数据
:----- :----- -----
评论数据
参数名 类型 说明
id int id
order_id int 订单ID
goods_id int 商品ID
uid uid 会员ID
nick_name string 评论人名称
head_img_url string 评论人头像
content string 评论内容
level int 评分等级
images json 评论图片
comment_id int 主评论ID
reply_id int 回复人ID
reply_name string 回复人名称
type int 1:评论 2:回复 3:追加
type_name string 类型名称
created_at string 评论时间
追加评论数据 data.append
回复评论数据 data.reply

备注:

  • 更多返回错误代码请看首页的错误代码描述