修改订单结算信息获取,门店服务商校验
This commit is contained in:
@@ -10,6 +10,8 @@ const (
|
||||
BillChargeTypeTimingFee = 10 // 定时宝,保险费
|
||||
)
|
||||
|
||||
//#region 获取门店订单的结算信息 bill/list
|
||||
|
||||
type Bill struct {
|
||||
AppPoiCode string `json:"app_poi_code"` // APP方门店id,传商家中台系统里门店的编码。如商家在操作绑定门店至开放平台应用中时,未绑定三方门店id信息,则默认APP方门店id与美团门店id相同。
|
||||
StartDate int64 `json:"start_date"` // 秒级时间戳
|
||||
@@ -31,18 +33,24 @@ type Bill struct {
|
||||
3)想要实现的效果;
|
||||
4)预计开发周期和上线时间;
|
||||
5)商家公司授权开通日账单接口的证明。(点击下载授权证明模板,授权证明以附件形式提供。)*/
|
||||
func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, error) {
|
||||
func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, int64, error) {
|
||||
// 门店订单结算信息(配送费和定时保险费)
|
||||
orderSettle := make(map[string]*SettleOrderList, 0)
|
||||
|
||||
// 门店订单的结算id
|
||||
var settleID int64 = 0
|
||||
for {
|
||||
result, err := a.AccessAPI3("bill/list", true, utils.Struct2Map(param, "", false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
var data *StoreBillListRes
|
||||
if err := utils.Map2StructByJson(result, &data, false); err != nil {
|
||||
return nil, err
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
if len(data.Data) > 0 && param.Offset == 0 {
|
||||
settleID = utils.Str2Int64(data.Data[0].SettleSettingId)
|
||||
}
|
||||
|
||||
for _, v := range data.Data {
|
||||
@@ -70,7 +78,7 @@ func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, error)
|
||||
}
|
||||
}
|
||||
|
||||
return orderSettle, nil
|
||||
return orderSettle, settleID, nil
|
||||
}
|
||||
|
||||
// StoreBillListReq 门店结算查询条件
|
||||
@@ -184,3 +192,5 @@ type SettleOrderList struct {
|
||||
DeliveryFee int64 `json:"delivery_fee"` // 配送费
|
||||
PlatformSettlement int64 `json:"platform_settlement"` // 平台结算金额
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
Reference in New Issue
Block a user