huangjiajun 7 месяцев назад
Родитель
Сommit
7cab73150b
2 измененных файлов: 106 добавлений и 0 удалений
  1. +61
    -0
      md/cps_pdd/order.go
  2. +45
    -0
      pdd_union/order.go

+ 61
- 0
md/cps_pdd/order.go Просмотреть файл

@@ -0,0 +1,61 @@
package cps_pdd

type CpsPddOrder struct {
OrderListGetResponse struct {
OrderList []struct {
ActivityTags []int `json:"activity_tags"`
AuthDuoId int `json:"auth_duo_id"`
BandanRiskConsult int `json:"bandan_risk_consult"`
BatchNo string `json:"batch_no"`
CashGiftId int `json:"cash_gift_id"`
CatIds []int `json:"cat_ids"`
CpaNew int `json:"cpa_new"`
CustomParameters string `json:"custom_parameters"`
FailReason string `json:"fail_reason"`
GoodsCategoryName string `json:"goods_category_name"`
GoodsId int `json:"goods_id"`
GoodsName string `json:"goods_name"`
GoodsPrice int `json:"goods_price"`
GoodsQuantity int `json:"goods_quantity"`
GoodsSign string `json:"goods_sign"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
GroupId int `json:"group_id"`
IsDirect int `json:"is_direct"`
MallId int `json:"mall_id"`
MallName string `json:"mall_name"`
NoSubsidyReason string `json:"no_subsidy_reason"`
OrderAmount int `json:"order_amount"`
OrderCreateTime int `json:"order_create_time"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
OrderModifyAt int `json:"order_modify_at"`
OrderPayTime int `json:"order_pay_time"`
OrderReceiveTime int `json:"order_receive_time"`
OrderSettleTime int `json:"order_settle_time"`
OrderSn string `json:"order_sn"`
OrderStatus int `json:"order_status"`
OrderStatusDesc string `json:"order_status_desc"`
OrderVerifyTime int `json:"order_verify_time"`
PId string `json:"p_id"`
PlatformDiscount int `json:"platform_discount"`
PriceCompareStatus int `json:"price_compare_status"`
PromotionAmount int `json:"promotion_amount"`
PromotionRate int `json:"promotion_rate"`
RedPacketType int `json:"red_packet_type"`
SceneAtMarketFee int `json:"scene_at_market_fee"`
SepDuoId int `json:"sep_duo_id"`
SepMarketFee int `json:"sep_market_fee"`
SepParameters string `json:"sep_parameters"`
SepPid string `json:"sep_pid"`
SepRate int `json:"sep_rate"`
ShareAmount int `json:"share_amount"`
ShareRate int `json:"share_rate"`
SubsidyAmount int `json:"subsidy_amount"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
SubsidyDuoAmountTenMillion int `json:"subsidy_duo_amount_ten_million"`
SubsidyType int `json:"subsidy_type"`
Type int `json:"type"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_list"`
TotalCount int `json:"total_count"`
} `json:"order_list_get_response"`
}

+ 45
- 0
pdd_union/order.go Просмотреть файл

@@ -0,0 +1,45 @@
package pdd_union

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md/cps_pdd"
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"encoding/json"
"strings"
)

func GetOrder(keyArr map[string]string, param map[string]interface{}) []map[string]string {
send, _ := Send(keyArr, "pdd.ddk.all.order.list.increment.get", param)
var res cps_pdd.CpsPddOrder
json.Unmarshal([]byte(send), &res)
var data = make([]map[string]string, 0)
for _, v := range res.OrderListGetResponse.OrderList {
if v.OrderStatus == -1 {
continue
}
tmp := map[string]string{}
tmp["check_success_time"] = zhios_third_party_utils.IntToStr(v.OrderVerifyTime)
tmp["oid"] = v.OrderSn
tmp["gid"] = v.GoodsSign
tmp["goods_title"] = v.GoodsName
tmp["commission"] = zhios_third_party_utils.Float64ToStr(float64(v.PromotionAmount) / 100)
tmp["commission_rate"] = zhios_third_party_utils.Float64ToStr(float64(v.PromotionRate) / 10)
tmp["goods_price"] = zhios_third_party_utils.Float64ToStr(float64(v.GoodsPrice) / 100)
tmp["payment"] = zhios_third_party_utils.Float64ToStr(float64(v.OrderAmount) / 100)
tmp["goods_img"] = v.GoodsThumbnailUrl
tmp["goods_num"] = zhios_third_party_utils.IntToStr(v.GoodsQuantity)
tmp["create_time"] = zhios_third_party_utils.IntToStr(v.OrderCreateTime)
tmp["payment_time"] = zhios_third_party_utils.IntToStr(v.OrderPayTime)
tmp["update_time"] = zhios_third_party_utils.IntToStr(v.OrderModifyAt)
tmp["status_str"] = v.OrderStatusDesc
tmp["pdd_pid"] = v.PId
tmp["fail_status"] = v.FailReason
tmp["custom_parameters"] = v.CustomParameters
tmp["status_str"] = v.OrderStatusDesc
tmp["ord_type"] = "0"
if strings.Contains(v.FailReason, "比价") || v.PriceCompareStatus == 1 {
tmp["ord_type"] = "1"
}
data = append(data, tmp)
}
return data
}

Загрузка…
Отмена
Сохранить