- 美团getOrderRefundDetail得到的Pictures是字符串,不是列表,需要手动再转一次
This commit is contained in:
@@ -109,7 +109,8 @@ type RefundOrderDetail struct {
|
||||
CTime int64 `json:"ctime"`
|
||||
Money float64 `json:"money"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
Pictures []string `json:"pictures"`
|
||||
Pictures string `json:"pictures"`
|
||||
PictureList []string `json:"pictureList"`
|
||||
RefundType int `json:"refund_type"`
|
||||
ResReason string `json:"res_reason"`
|
||||
ResType int `json:"res_type"`
|
||||
@@ -451,7 +452,7 @@ func (a *API) OrderLogisticsChange2Self(orderID int64) (err error) {
|
||||
}
|
||||
|
||||
// refundOrderDetailList不能定义为[]*RefundOrderDetail,否则会有解析错误,原因不明
|
||||
func (a *API) GetOrderRefundDetail(orderID int64, refundType int) (refundOrderDetailList []RefundOrderDetail, err error) {
|
||||
func (a *API) GetOrderRefundDetail(orderID int64, refundType int) (refundOrderDetailList []*RefundOrderDetail, err error) {
|
||||
params := map[string]interface{}{
|
||||
"wm_order_id_view": orderID,
|
||||
}
|
||||
@@ -460,7 +461,15 @@ func (a *API) GetOrderRefundDetail(orderID int64, refundType int) (refundOrderDe
|
||||
}
|
||||
result, err := a.AccessAPI("ecommerce/order/getOrderRefundDetail", true, params)
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result, &refundOrderDetailList, false)
|
||||
if err = utils.Map2StructByJson(result, &refundOrderDetailList, false); err == nil {
|
||||
for _, v := range refundOrderDetailList {
|
||||
if v.Pictures != "" {
|
||||
if err = utils.UnmarshalUseNumber([]byte(v.Pictures), &v.PictureList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return refundOrderDetailList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user