zhangxinlei1996 3 years ago
parent
commit
ef0ca5a140
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/jfw/modules/subscribepay/src/service/dataexportPack.go

+ 6 - 4
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -69,10 +69,12 @@ func (this *DataExportPack) PackGoodsList() {
 						"normal_discount": vv.Normal_discount,
 						"senior_discount": vv.Senior_discount,
 					}
-					for _, v := range qutil.ObjArrToMapArr(resMap["Data"].([]interface{})) {
-						product := strconv.Itoa(qutil.IntAll(v["ProductCode"]))
-						if strings.Contains(proDuctM[product], strconv.Itoa(vv.PackNum)) {
-							m[fmt.Sprintf("%v_num", strings.Split(proDuctM[product], "_")[0])] = v["Time"]
+					if resMap["Data"] != nil {
+						for _, v := range qutil.ObjArrToMapArr(resMap["Data"].([]interface{})) {
+							product := strconv.Itoa(qutil.IntAll(v["ProductCode"]))
+							if strings.Contains(proDuctM[product], strconv.Itoa(vv.PackNum)) {
+								m[fmt.Sprintf("%v_num", strings.Split(proDuctM[product], "_")[0])] = v["Time"]
+							}
 						}
 					}
 					marr = append(marr, m)