瀏覽代碼

Merge branch 'develop' of k.zhang/duoduo into master

k.zhang 4 年之前
父節點
當前提交
e191e1ad3a

+ 1 - 0
apis/pdd/base.go

@@ -12,6 +12,7 @@ func InitPddDdkRouter(engine *gin.RouterGroup) {
 		v1.POST("/pdd/url/generate", PddDdkGoodsPromotionUrlGenerate) //多多客 生成单品推广链接                                        //多多客 生成单品推广链接
 		v1.POST("/pdd/order/list", PddDdkOrderListIncrementGet)
 		v1.POST("/pdd/pid/query", PddDdkGoodsPidQuery)
+		v1.POST("/pdd/recommend/get", DdkGoodsRecommendGet) //多多进宝商品推荐API
 	}
 }
 func InitSetRouter(engine *gin.RouterGroup) {

+ 4 - 0
apis/pdd/pdd.ddk.goods.detail.go

@@ -7,6 +7,7 @@ import (
 	"duoduo/tools/app"
 	"fmt"
 	"github.com/gin-gonic/gin"
+	"github.com/shopspring/decimal"
 	"time"
 )
 
@@ -64,5 +65,8 @@ func PddDdkGoodsDetail(c *gin.Context) {
 		return
 	}
 
+	outData.GoodsDetailResponse.GoodsDetails[0].MinAmount = decimal.NewFromInt(outData.GoodsDetailResponse.GoodsDetails[0].MinGroupPrice).Sub(decimal.NewFromInt(outData.GoodsDetailResponse.GoodsDetails[0].CouponDiscount)).Div(decimal.NewFromInt(100)).Round(2)
+	outData.GoodsDetailResponse.GoodsDetails[0].Rebate = outData.GoodsDetailResponse.GoodsDetails[0].MinAmount.Mul(decimal.NewFromInt(outData.GoodsDetailResponse.GoodsDetails[0].PromotionRate)).Div(decimal.NewFromInt(1000)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+
 	app.OK(c, outData, app.Success)
 }

+ 73 - 0
apis/pdd/pdd.ddk.goods.recommend.get.go

@@ -0,0 +1,73 @@
+package pdd
+
+import (
+	"duoduo/conf"
+	"duoduo/models/pdd"
+	"duoduo/tools"
+	"duoduo/tools/app"
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"github.com/shopspring/decimal"
+	"time"
+)
+
+func DdkGoodsRecommendGet(c *gin.Context) {
+	var inData pdd.DdkGoodsRecommendGetRequest
+	var outData pdd.DdkGoodsRecommendGetResponse
+	var pddErr pdd.ErrorPddResponse
+
+	confIni, err := conf.ConnIni()
+	if err != nil {
+		app.Error(c, 400, err, err.Error())
+		return
+	}
+
+	err = c.ShouldBindJSON(&inData)
+	if err != nil {
+		app.Error(c, 400, err, err.Error())
+		return
+	}
+
+	inData.ClientId = confIni.MustValue("pdd", "client_id")
+	inData.Type = "pdd.ddk.goods.recommend.get"
+	inData.Timestamp = fmt.Sprintf("%d", time.Now().Unix())
+	inData.DataType = "JSON"
+
+	inData.Sign = "sign"
+
+	sign, err := DDKSign(inData)
+	if err != nil {
+		app.Error(c, 400, err, err.Error())
+		return
+	}
+
+	inData.Sign = sign
+	val, err := PostDDk(inData, nil)
+	if err != nil {
+		app.Error(c, 400, err, err.Error())
+		return
+	}
+
+	err = tools.JsonUnmarshal(val, &pddErr)
+	if err != nil {
+		app.Error(c, 500, err, err.Error())
+		return
+	}
+	if pddErr.ErrorResponse.ErrorCode != 0 {
+		app.Error(c, 500, err, pddErr.ErrorResponse.ErrorMsg)
+		return
+	}
+
+	err = tools.JsonUnmarshal(val, &outData)
+	if err != nil {
+		app.Error(c, 500, err, err.Error())
+		return
+	}
+
+	for i := 0; i < len(outData.GoodsBasicDetailResponse.List); i++ {
+		outData.GoodsBasicDetailResponse.List[i].MinAmount = decimal.NewFromInt(outData.GoodsBasicDetailResponse.List[i].MinGroupPrice).Sub(decimal.NewFromInt(outData.GoodsBasicDetailResponse.List[i].CouponDiscount)).Div(decimal.NewFromInt(100)).Round(2)
+		outData.GoodsBasicDetailResponse.List[i].Rebate = outData.GoodsBasicDetailResponse.List[i].MinAmount.Mul(decimal.NewFromInt(outData.GoodsBasicDetailResponse.List[i].PromotionRate)).Div(decimal.NewFromInt(1000)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+	}
+
+	app.OK(c, outData, app.Success)
+}

+ 9 - 9
apis/pdd/pdd.ddk.goods.search.go

@@ -7,6 +7,7 @@ import (
 	"duoduo/tools/app"
 	"fmt"
 	"github.com/gin-gonic/gin"
+	"github.com/shopspring/decimal"
 
 	"time"
 )
@@ -16,21 +17,13 @@ func PddDdkGoodsSearch(c *gin.Context) {
 	var inData pdd.PddDdkGoodsSearchRequest
 	var outData pdd.PddDdkGoodsSearchResponse
 	var pddErr pdd.ErrorPddResponse
-	//var p []byte
+
 	confIni, err := conf.ConnIni()
 	if err != nil {
 		app.Error(c, 400, err, err.Error())
 		return
 	}
-	//
-	//body, _ := ioutil.ReadAll(c.Request.Body)
-	//if body != nil {
-	//	fmt.Print("请求body内容为:%s", string(body))
-	//}
 
-	//fmt.Print(string(c.Request.Body))
-	//c.Request.Body.Read(p)
-	//fmt.Print("p= ", string(p))
 	err = c.ShouldBindJSON(&inData)
 	if err != nil {
 		app.Error(c, 400, err, err.Error())
@@ -60,6 +53,7 @@ func PddDdkGoodsSearch(c *gin.Context) {
 		app.Error(c, 400, err, err.Error())
 		return
 	}
+	fmt.Println("val = ", val)
 	err = tools.JsonUnmarshal(val, &outData)
 	if err != nil {
 		err = tools.JsonUnmarshal(val, &pddErr)
@@ -70,6 +64,12 @@ func PddDdkGoodsSearch(c *gin.Context) {
 		app.Error(c, 500, nil, pddErr.ErrorResponse.ErrorMsg)
 		return
 	}
+
+	for i := 0; i < len(outData.GoodsSearchResponse.GoodsList); i++ {
+		outData.GoodsSearchResponse.GoodsList[i].MinAmount = decimal.NewFromInt(outData.GoodsSearchResponse.GoodsList[i].MinGroupPrice).Sub(decimal.NewFromInt(outData.GoodsSearchResponse.GoodsList[i].CouponDiscount)).Div(decimal.NewFromInt(100)).Round(2)
+		outData.GoodsSearchResponse.GoodsList[i].Rebate = outData.GoodsSearchResponse.GoodsList[i].MinAmount.Mul(decimal.NewFromInt(outData.GoodsSearchResponse.GoodsList[i].PromotionRate)).Div(decimal.NewFromInt(1000)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+	}
+
 	app.OK(c, outData, app.Success)
 
 }

+ 7 - 7
apis/pdd/pdd.ddk.order.list.increment.get.go

@@ -133,11 +133,11 @@ func PddDdkOrderListIncrementGet(c *gin.Context) {
 				continue
 			}
 
-			walletVal.LatelyAmount = walletVal.LatelyAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.TodayAmount = walletVal.TodayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.TotalAmount = walletVal.TotalAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.YesterdayAmount = walletVal.YesterdayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.AvailableAmount = walletVal.AvailableAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
+			walletVal.LatelyAmount = walletVal.LatelyAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.TodayAmount = walletVal.TodayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.TotalAmount = walletVal.TotalAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.YesterdayAmount = walletVal.YesterdayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.AvailableAmount = walletVal.AvailableAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
 
 			trans.TransStatus = 3
 			trans.OpenID = pidVal.OpenID
@@ -145,8 +145,8 @@ func PddDdkOrderListIncrementGet(c *gin.Context) {
 			if err != nil {
 				continue
 			}
-			walletVal.WithdrawalAmount = transVal.Amount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.AvailableAmount = walletVal.AvailableAmount.Sub(walletVal.WithdrawalAmount).Mul(decimal.NewFromFloat(0.5))
+			walletVal.WithdrawalAmount = transVal.Amount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.AvailableAmount = walletVal.AvailableAmount.Sub(walletVal.WithdrawalAmount).Mul(decimal.NewFromFloat(0.6)).Round(2)
 
 			//更新钱包
 			walletVal.OpenID = pidVal.OpenID

+ 1 - 1
apis/pdd/set.go

@@ -16,7 +16,7 @@ func Set(c *gin.Context) {
 		return
 	}
 
-	if inData.Version == "1.0.2" {
+	if inData.Version == "1.0.3" {
 		outData.Type = "true"
 		app.OK(c, outData, app.Success)
 	} else {

+ 1 - 1
models/mysql/pid.go

@@ -16,7 +16,7 @@ func (p *Pid) TableName() string {
 }
 
 //     自己 上  上上
-//级别 0.5 0.15 0.05  70% 交税+
+//级别 0.6 0.1 0.1  70% 交税+
 func (p *Pid) Get() (Pid, error) {
 	var doc Pid
 	err := orm.Eloquent.Select("pid").Where("open_id = ?  and pid_status = ?", p.OpenID, p.PidStatus).Table(p.TableName()).First(&doc).Error

+ 53 - 49
models/pdd/pdd.ddk.goods.detail.go

@@ -1,5 +1,7 @@
 package pdd
 
+import "github.com/shopspring/decimal"
+
 type PddDdkGoodsDetailRequest struct {
 	PddDdkBase
 	GoodsSign string `json:"goods_sign"`
@@ -11,55 +13,57 @@ type PddDdkGoodsDetailResponse struct {
 	GoodsDetailResponse GoodsDetailResponse `json:"goods_detail_response"`
 }
 type GoodsDetails struct {
-	CategoryName                string        `json:"category_name"`
-	CouponRemainQuantity        int           `json:"coupon_remain_quantity"`
-	PromotionRate               int           `json:"promotion_rate"`
-	ServiceTags                 []int         `json:"service_tags"`
-	MallID                      int           `json:"mall_id"`
-	MallName                    string        `json:"mall_name"`
-	MallCouponEndTime           int           `json:"mall_coupon_end_time"`
-	LgstTxt                     string        `json:"lgst_txt"`
-	GoodsName                   string        `json:"goods_name"`
-	GoodsGalleryUrls            []string      `json:"goods_gallery_urls"`
-	GoodsID                     int64         `json:"goods_id"`
-	BrandName                   string        `json:"brand_name"`
-	PredictPromotionRate        int           `json:"predict_promotion_rate"`
-	GoodsDesc                   string        `json:"goods_desc"`
-	OptName                     string        `json:"opt_name"`
-	ShareRate                   int           `json:"share_rate"`
-	OptIds                      []int         `json:"opt_ids"`
-	GoodsImageURL               string        `json:"goods_image_url"`
-	MallImgURL                  string        `json:"mall_img_url"`
-	HasMallCoupon               bool          `json:"has_mall_coupon"`
-	UnifiedTags                 []string      `json:"unified_tags"`
-	VideoUrls                   []interface{} `json:"video_urls"`
-	CouponStartTime             int           `json:"coupon_start_time"`
-	MinGroupPrice               int           `json:"min_group_price"`
-	CouponDiscount              int           `json:"coupon_discount"`
-	CouponEndTime               int           `json:"coupon_end_time"`
-	ZsDuoID                     int           `json:"zs_duo_id"`
-	MallCouponRemainQuantity    int           `json:"mall_coupon_remain_quantity"`
-	PlanType                    int           `json:"plan_type"`
-	CatIds                      []int         `json:"cat_ids"`
-	CouponMinOrderAmount        int           `json:"coupon_min_order_amount"`
-	CategoryID                  int           `json:"category_id"`
-	MallCouponDiscountPct       int           `json:"mall_coupon_discount_pct"`
-	CouponTotalQuantity         int           `json:"coupon_total_quantity"`
-	MallCouponMinOrderAmount    int           `json:"mall_coupon_min_order_amount"`
-	MerchantType                int           `json:"merchant_type"`
-	SalesTip                    string        `json:"sales_tip"`
-	OnlySceneAuth               bool          `json:"only_scene_auth"`
-	DescTxt                     string        `json:"desc_txt"`
-	GoodsThumbnailURL           string        `json:"goods_thumbnail_url"`
-	OptID                       int           `json:"opt_id"`
-	HasCoupon                   bool          `json:"has_coupon"`
-	MinNormalPrice              int           `json:"min_normal_price"`
-	MallCouponStartTime         int           `json:"mall_coupon_start_time"`
-	ServTxt                     string        `json:"serv_txt"`
-	MallCouponTotalQuantity     int           `json:"mall_coupon_total_quantity"`
-	MallCouponMaxDiscountAmount int           `json:"mall_coupon_max_discount_amount"`
-	MallCps                     int           `json:"mall_cps"`
-	GoodsSign                   string        `json:"goods_sign"`
+	CategoryName                string          `json:"category_name"`
+	CouponRemainQuantity        int             `json:"coupon_remain_quantity"`
+	PromotionRate               int64           `json:"promotion_rate"`
+	ServiceTags                 []int           `json:"service_tags"`
+	MallID                      int             `json:"mall_id"`
+	MallName                    string          `json:"mall_name"`
+	MallCouponEndTime           int             `json:"mall_coupon_end_time"`
+	LgstTxt                     string          `json:"lgst_txt"`
+	GoodsName                   string          `json:"goods_name"`
+	GoodsGalleryUrls            []string        `json:"goods_gallery_urls"`
+	GoodsID                     int64           `json:"goods_id"`
+	BrandName                   string          `json:"brand_name"`
+	PredictPromotionRate        int             `json:"predict_promotion_rate"`
+	GoodsDesc                   string          `json:"goods_desc"`
+	OptName                     string          `json:"opt_name"`
+	ShareRate                   int             `json:"share_rate"`
+	OptIds                      []int           `json:"opt_ids"`
+	GoodsImageURL               string          `json:"goods_image_url"`
+	MallImgURL                  string          `json:"mall_img_url"`
+	HasMallCoupon               bool            `json:"has_mall_coupon"`
+	UnifiedTags                 []string        `json:"unified_tags"`
+	VideoUrls                   []interface{}   `json:"video_urls"`
+	CouponStartTime             int             `json:"coupon_start_time"`
+	MinGroupPrice               int64           `json:"min_group_price"`
+	CouponDiscount              int64           `json:"coupon_discount"`
+	CouponEndTime               int             `json:"coupon_end_time"`
+	ZsDuoID                     int             `json:"zs_duo_id"`
+	MallCouponRemainQuantity    int             `json:"mall_coupon_remain_quantity"`
+	PlanType                    int             `json:"plan_type"`
+	CatIds                      []int           `json:"cat_ids"`
+	CouponMinOrderAmount        int             `json:"coupon_min_order_amount"`
+	CategoryID                  int             `json:"category_id"`
+	MallCouponDiscountPct       int             `json:"mall_coupon_discount_pct"`
+	CouponTotalQuantity         int             `json:"coupon_total_quantity"`
+	MallCouponMinOrderAmount    int             `json:"mall_coupon_min_order_amount"`
+	MerchantType                int             `json:"merchant_type"`
+	SalesTip                    string          `json:"sales_tip"`
+	OnlySceneAuth               bool            `json:"only_scene_auth"`
+	DescTxt                     string          `json:"desc_txt"`
+	GoodsThumbnailURL           string          `json:"goods_thumbnail_url"`
+	OptID                       int             `json:"opt_id"`
+	HasCoupon                   bool            `json:"has_coupon"`
+	MinNormalPrice              int             `json:"min_normal_price"`
+	MallCouponStartTime         int             `json:"mall_coupon_start_time"`
+	ServTxt                     string          `json:"serv_txt"`
+	MallCouponTotalQuantity     int             `json:"mall_coupon_total_quantity"`
+	MallCouponMaxDiscountAmount int             `json:"mall_coupon_max_discount_amount"`
+	MallCps                     int             `json:"mall_cps"`
+	GoodsSign                   string          `json:"goods_sign"`
+	MinAmount                   decimal.Decimal `json:"min_amount"`
+	Rebate                      decimal.Decimal `json:"rebate"`
 }
 type GoodsDetailResponse struct {
 	GoodsDetails []GoodsDetails `json:"goods_details"`

+ 62 - 0
models/pdd/pdd.ddk.goods.recommend.get.go

@@ -0,0 +1,62 @@
+package pdd
+
+import "github.com/shopspring/decimal"
+
+type DdkGoodsRecommendGetRequest struct {
+	PddDdkBase
+	CatId       string `json:"cat_id"`       //猜你喜欢场景的商品类目,20100-百货,20200-母婴,20300-食品,20400-女装,20500-电器,20600-鞋包,20700-内衣,20800-美妆,20900-男装,21000-水果,21100-家纺,21200-文具,21300-运动,21400-虚拟,21500-汽车,21600-家装,21700-家具,21800-医药;
+	ChannelType string `json:"channel_type"` //进宝频道推广商品: 1-今日销量榜,3-相似商品推荐,4-猜你喜欢(和进宝网站精选一致),5-实时热销榜,6-实时收益榜。默认值5
+	Offset      string `json:"offset"`       //从多少位置开始请求;默认值 : 0,offset需是limit的整数倍,仅支持整页翻页
+	Limit       string `json:"limit"`        //一页请求数量;默认值 : 20
+	Pid         string `json:"pid"`          //推广位id
+}
+
+//type DdkGoodsRecommendGetResponse struct {
+//}
+
+type DdkGoodsRecommendGetResponse struct {
+	GoodsBasicDetailResponse GoodsBasicDetailResponse `json:"goods_basic_detail_response"`
+}
+type List struct {
+	CategoryName         string          `json:"category_name"`
+	CouponRemainQuantity int             `json:"coupon_remain_quantity"`
+	PromotionRate        int64           `json:"promotion_rate"`
+	CatIds               []int           `json:"cat_ids"`
+	CouponMinOrderAmount int             `json:"coupon_min_order_amount"`
+	CategoryID           string          `json:"category_id"`
+	MallID               int             `json:"mall_id"`
+	MallName             string          `json:"mall_name"`
+	CouponTotalQuantity  int             `json:"coupon_total_quantity"`
+	MerchantType         string          `json:"merchant_type"`
+	LgstTxt              string          `json:"lgst_txt"`
+	GoodsName            string          `json:"goods_name"`
+	SalesTip             string          `json:"sales_tip"`
+	GoodsID              int64           `json:"goods_id"`
+	PredictPromotionRate int             `json:"predict_promotion_rate"`
+	DescTxt              string          `json:"desc_txt"`
+	GoodsDesc            string          `json:"goods_desc"`
+	OptName              string          `json:"opt_name"`
+	ShareRate            int             `json:"share_rate"`
+	GoodsThumbnailURL    string          `json:"goods_thumbnail_url"`
+	OptIds               []int           `json:"opt_ids"`
+	OptID                string          `json:"opt_id"`
+	GoodsImageURL        string          `json:"goods_image_url"`
+	ActivityTags         []int           `json:"activity_tags"`
+	HasCoupon            bool            `json:"has_coupon"`
+	MinNormalPrice       int             `json:"min_normal_price"`
+	ServTxt              string          `json:"serv_txt"`
+	UnifiedTags          []string        `json:"unified_tags"`
+	CouponStartTime      int             `json:"coupon_start_time"`
+	MinGroupPrice        int64           `json:"min_group_price"`
+	CouponDiscount       int64           `json:"coupon_discount"`
+	GoodsSign            string          `json:"goods_sign"`
+	CouponEndTime        int             `json:"coupon_end_time"`
+	ExtraCouponAmount    int             `json:"extra_coupon_amount,omitempty"`
+	MinAmount            decimal.Decimal `json:"min_amount"`
+	Rebate               decimal.Decimal `json:"rebate"`
+}
+type GoodsBasicDetailResponse struct {
+	Total     int    `json:"total"`
+	List      []List `json:"list"`
+	RequestID string `json:"request_id"`
+}

+ 63 - 59
models/pdd/pdd.ddk.goods.search.go

@@ -1,5 +1,7 @@
 package pdd
 
+import "github.com/shopspring/decimal"
+
 type PddDdkGoodsSearchRequest struct {
 	ClientId     string `json:"client_id"`
 	Page         string `json:"page"`
@@ -19,65 +21,67 @@ type PddDdkGoodsSearchResponse struct {
 	GoodsSearchResponse GoodsSearchResponse `json:"goods_search_response"`
 }
 type GoodsList struct {
-	ActivityPromotionRate       int      `json:"activity_promotion_rate"`
-	ActivityTags                []int    `json:"activity_tags"`
-	ActivityType                int      `json:"activity_type"`
-	BrandName                   string   `json:"brand_name"`
-	CatIds                      []int    `json:"cat_ids"`
-	CltCpnBatchSn               string   `json:"clt_cpn_batch_sn"`
-	CltCpnDiscount              int      `json:"clt_cpn_discount"`
-	CltCpnEndTime               int      `json:"clt_cpn_end_time"`
-	CltCpnMinAmt                int      `json:"clt_cpn_min_amt"`
-	CltCpnQuantity              int      `json:"clt_cpn_quantity"`
-	CltCpnRemainQuantity        int      `json:"clt_cpn_remain_quantity"`
-	CltCpnStartTime             int      `json:"clt_cpn_start_time"`
-	CouponDiscount              int      `json:"coupon_discount"`
-	CouponEndTime               int      `json:"coupon_end_time"`
-	CouponMinOrderAmount        int      `json:"coupon_min_order_amount"`
-	CouponRemainQuantity        int      `json:"coupon_remain_quantity"`
-	CouponStartTime             int      `json:"coupon_start_time"`
-	CouponTotalQuantity         int      `json:"coupon_total_quantity"`
-	CreateAt                    int      `json:"create_at"`
-	DescTxt                     string   `json:"desc_txt"`
-	ExtraCouponAmount           int      `json:"extra_coupon_amount"`
-	GoodsDesc                   string   `json:"goods_desc"`
-	GoodsImageURL               string   `json:"goods_image_url"`
-	GoodsLabels                 []int    `json:"goods_labels"`
-	GoodsName                   string   `json:"goods_name"`
-	GoodsSign                   string   `json:"goods_sign"`
-	GoodsThumbnailURL           string   `json:"goods_thumbnail_url"`
-	HasCoupon                   bool     `json:"has_coupon"`
-	HasMallCoupon               bool     `json:"has_mall_coupon"`
-	LgstTxt                     string   `json:"lgst_txt"`
-	MallCouponDiscountPct       int      `json:"mall_coupon_discount_pct"`
-	MallCouponEndTime           int      `json:"mall_coupon_end_time"`
-	MallCouponID                int      `json:"mall_coupon_id"`
-	MallCouponMaxDiscountAmount int      `json:"mall_coupon_max_discount_amount"`
-	MallCouponMinOrderAmount    int      `json:"mall_coupon_min_order_amount"`
-	MallCouponRemainQuantity    int      `json:"mall_coupon_remain_quantity"`
-	MallCouponStartTime         int      `json:"mall_coupon_start_time"`
-	MallCouponTotalQuantity     int      `json:"mall_coupon_total_quantity"`
-	MallCps                     int      `json:"mall_cps"`
-	MallID                      int      `json:"mall_id"`
-	MallName                    string   `json:"mall_name"`
-	MerchantType                int      `json:"merchant_type"`
-	MinGroupPrice               int      `json:"min_group_price"`
-	MinNormalPrice              int      `json:"min_normal_price"`
-	OnlySceneAuth               bool     `json:"only_scene_auth"`
-	OptID                       int      `json:"opt_id"`
-	OptIds                      []int    `json:"opt_ids"`
-	OptName                     string   `json:"opt_name"`
-	PlanType                    int      `json:"plan_type"`
-	PredictPromotionRate        int      `json:"predict_promotion_rate"`
-	PromotionRate               int      `json:"promotion_rate"`
-	SalesTip                    string   `json:"sales_tip"`
-	SearchID                    string   `json:"search_id"`
-	ServTxt                     string   `json:"serv_txt"`
-	ServiceTags                 []int    `json:"service_tags"`
-	ShareRate                   int      `json:"share_rate"`
-	SubsidyAmount               int      `json:"subsidy_amount"`
-	UnifiedTags                 []string `json:"unified_tags"`
-	ZsDuoID                     int      `json:"zs_duo_id"`
+	ActivityPromotionRate       int             `json:"activity_promotion_rate"`
+	ActivityTags                []int           `json:"activity_tags"`
+	ActivityType                int             `json:"activity_type"`
+	BrandName                   string          `json:"brand_name"`
+	CatIds                      []int           `json:"cat_ids"`
+	CltCpnBatchSn               string          `json:"clt_cpn_batch_sn"`
+	CltCpnDiscount              int             `json:"clt_cpn_discount"`
+	CltCpnEndTime               int             `json:"clt_cpn_end_time"`
+	CltCpnMinAmt                int             `json:"clt_cpn_min_amt"`
+	CltCpnQuantity              int             `json:"clt_cpn_quantity"`
+	CltCpnRemainQuantity        int             `json:"clt_cpn_remain_quantity"`
+	CltCpnStartTime             int             `json:"clt_cpn_start_time"`
+	CouponDiscount              int64           `json:"coupon_discount"`
+	CouponEndTime               int             `json:"coupon_end_time"`
+	CouponMinOrderAmount        int             `json:"coupon_min_order_amount"`
+	CouponRemainQuantity        int             `json:"coupon_remain_quantity"`
+	CouponStartTime             int             `json:"coupon_start_time"`
+	CouponTotalQuantity         int             `json:"coupon_total_quantity"`
+	CreateAt                    int             `json:"create_at"`
+	DescTxt                     string          `json:"desc_txt"`
+	ExtraCouponAmount           int             `json:"extra_coupon_amount"`
+	GoodsDesc                   string          `json:"goods_desc"`
+	GoodsImageURL               string          `json:"goods_image_url"`
+	GoodsLabels                 []int           `json:"goods_labels"`
+	GoodsName                   string          `json:"goods_name"`
+	GoodsSign                   string          `json:"goods_sign"`
+	GoodsThumbnailURL           string          `json:"goods_thumbnail_url"`
+	HasCoupon                   bool            `json:"has_coupon"`
+	HasMallCoupon               bool            `json:"has_mall_coupon"`
+	LgstTxt                     string          `json:"lgst_txt"`
+	MallCouponDiscountPct       int             `json:"mall_coupon_discount_pct"`
+	MallCouponEndTime           int             `json:"mall_coupon_end_time"`
+	MallCouponID                int             `json:"mall_coupon_id"`
+	MallCouponMaxDiscountAmount int             `json:"mall_coupon_max_discount_amount"`
+	MallCouponMinOrderAmount    int             `json:"mall_coupon_min_order_amount"`
+	MallCouponRemainQuantity    int             `json:"mall_coupon_remain_quantity"`
+	MallCouponStartTime         int             `json:"mall_coupon_start_time"`
+	MallCouponTotalQuantity     int             `json:"mall_coupon_total_quantity"`
+	MallCps                     int             `json:"mall_cps"`
+	MallID                      int             `json:"mall_id"`
+	MallName                    string          `json:"mall_name"`
+	MerchantType                int             `json:"merchant_type"`
+	MinGroupPrice               int64           `json:"min_group_price"`
+	MinNormalPrice              int             `json:"min_normal_price"`
+	OnlySceneAuth               bool            `json:"only_scene_auth"`
+	OptID                       int             `json:"opt_id"`
+	OptIds                      []int           `json:"opt_ids"`
+	OptName                     string          `json:"opt_name"`
+	PlanType                    int             `json:"plan_type"`
+	PredictPromotionRate        int             `json:"predict_promotion_rate"`
+	PromotionRate               int64           `json:"promotion_rate"`
+	SalesTip                    string          `json:"sales_tip"`
+	SearchID                    string          `json:"search_id"`
+	ServTxt                     string          `json:"serv_txt"`
+	ServiceTags                 []int           `json:"service_tags"`
+	ShareRate                   int             `json:"share_rate"`
+	SubsidyAmount               int             `json:"subsidy_amount"`
+	UnifiedTags                 []string        `json:"unified_tags"`
+	ZsDuoID                     int             `json:"zs_duo_id"`
+	MinAmount                   decimal.Decimal `json:"min_amount"`
+	Rebate                      decimal.Decimal `json:"rebate"`
 }
 type GoodsSearchResponse struct {
 	GoodsList  []GoodsList `json:"goods_list"`

+ 7 - 7
report/pdd.ddk.order.list.increment.get.go

@@ -120,11 +120,11 @@ func DdkOrder() {
 				continue
 			}
 
-			walletVal.LatelyAmount = walletVal.LatelyAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.TodayAmount = walletVal.TodayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.TotalAmount = walletVal.TotalAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.YesterdayAmount = walletVal.YesterdayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.AvailableAmount = walletVal.AvailableAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
+			walletVal.LatelyAmount = walletVal.LatelyAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.TodayAmount = walletVal.TodayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.TotalAmount = walletVal.TotalAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.YesterdayAmount = walletVal.YesterdayAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.AvailableAmount = walletVal.AvailableAmount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
 
 			trans.TransStatus = 3
 			trans.OpenID = pidVal.OpenID
@@ -132,8 +132,8 @@ func DdkOrder() {
 			if err != nil {
 				continue
 			}
-			walletVal.WithdrawalAmount = transVal.Amount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.5))
-			walletVal.AvailableAmount = walletVal.AvailableAmount.Sub(walletVal.WithdrawalAmount).Mul(decimal.NewFromFloat(0.5))
+			walletVal.WithdrawalAmount = transVal.Amount.Div(decimal.NewFromInt(100)).Mul(decimal.NewFromFloat(0.6)).Round(2)
+			walletVal.AvailableAmount = walletVal.AvailableAmount.Sub(walletVal.WithdrawalAmount).Mul(decimal.NewFromFloat(0.6)).Round(2)
 
 			//更新钱包
 			walletVal.OpenID = pidVal.OpenID