Jelajahi Sumber

fix:数组转换问题修复

zhangxinlei1996 2 tahun lalu
induk
melakukan
25eae9fcbf
1 mengubah file dengan 10 tambahan dan 2 penghapusan
  1. 10 2
      service/power.go

+ 10 - 2
service/power.go

@@ -132,7 +132,7 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
 				areacount := common.Int64All((*oBuyset)["areacount"])
 				buyerclasscount := common.Int64All((*oBuyset)["buyerclasscount"])
 				newcitys, _ := (*oBuyset)["newcitys"].([]interface{})
-				newcitysArr := common.InterfaceArrToint64Arr(newcitys)
+				newcitysArr := ConfirmInt64Arr(newcitys)
 				vip = &entity.Vip{
 					Status:          vipStatus,
 					StartTime:       vipStartTime,
@@ -230,7 +230,7 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
 						areacount := common.Int64All((*oBuyset)["areacount"])
 						buyerclasscount := common.Int64All((*oBuyset)["buyerclasscount"])
 						newcitys, _ := (*oBuyset)["newcitys"].([]interface{})
-						newcitysArr := common.InterfaceArrToint64Arr(newcitys)
+						newcitysArr := ConfirmInt64Arr(newcitys)
 						status := common.Int64All((*eudata)["i_vip_status"])
 						starttime := common.Int64All((*eudata)["l_vip_starttime"])
 						endtime := common.Int64All((*eudata)["l_vip_endtime"])
@@ -463,3 +463,11 @@ func intStringsJoin(is []int64) string {
 	}
 	return strings.Join(str, ",")
 }
+
+func ConfirmInt64Arr(arr []interface{}) []int64 {
+	tmp := make([]int64, 0)
+	for _, v := range arr {
+		tmp = append(tmp, common.Int64All(v))
+	}
+	return tmp
+}