1
This commit is contained in:
@@ -108,14 +108,24 @@ func TestRetailDiscountBatchSave(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRetailDiscountList(t *testing.T) { //56 1001
|
||||
result, err := api.RetailDiscountList("32235182", 56)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
threefoldDown := 0 // 0-3 折活动数量
|
||||
threefoldUp := 0 // 3.01-9 折活动
|
||||
// 获取美团活动
|
||||
directList, _ := api.RetailDiscountList("32235182", RetailActTypeDirectDown) // 折扣活动
|
||||
for _, v := range directList {
|
||||
if (v.ActPrice/v.OriginalPrice)*10 >= 3.01 {
|
||||
threefoldUp++
|
||||
} else {
|
||||
threefoldDown++
|
||||
}
|
||||
}
|
||||
//for _, v := range result {
|
||||
// globals.SugarLogger.Debugf("%s", utils.Format4Output(v, false))
|
||||
//}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
secKillList, _ := api.RetailDiscountList("32235182", RetailActTypeSecKill) // 爆品活动
|
||||
if secKillList != nil {
|
||||
threefoldDown = threefoldDown + len(secKillList)
|
||||
}
|
||||
|
||||
fmt.Println(threefoldDown)
|
||||
fmt.Println(threefoldDown)
|
||||
}
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user