Răsfoiți Sursa

fix:关注列表修改

duxin 2 ani în urmă
părinte
comite
a21e4e0b09

+ 7 - 5
entniche_new/src/service/customer/customer.go

@@ -159,7 +159,6 @@ func (this *CustomerAction) CustomerQuery() {
 			data = VarCustomer.GetCustomerNumb(entUserId, config.Config.CustomerNumb.PersonalNumb)
 		}
 		//格式化数据
-
 		if customerList != nil {
 			customerName := []string{}
 			numb := 0
@@ -1305,11 +1304,14 @@ func (this *CustomerAction) CstList() {
 			}
 		}
 		var cInfoArr []*CustomerInfo
-		if (pageNo+1)*pageSize >= len(res) {
-			cInfoArr = res[pageNo*pageSize:]
-		} else {
-			cInfoArr = res[pageNo*pageSize : (pageNo+1)*pageSize]
+		if len(res) > 0 {
+			if (pageNo+1)*pageSize >= len(res) {
+				cInfoArr = res[pageNo*pageSize:]
+			} else {
+				cInfoArr = res[pageNo*pageSize : (pageNo+1)*pageSize]
+			}
 		}
+
 		return Result{Data: map[string]interface{}{
 			"list":     cInfoArr,
 			"total":    len(res),

+ 6 - 4
entniche_new/src/service/follow/project.go

@@ -142,10 +142,12 @@ func (this *FollowProject) FollowList() {
 			list = append(list, v)
 		}
 		var sList []map[string]interface{}
-		if (pNum+1)*pSize >= len(list) {
-			sList = list[pNum*pSize:]
-		} else {
-			sList = list[pNum*pSize : (pNum+1)*pSize]
+		if len(list) > 0 {
+			if (pNum+1)*pSize >= len(list) {
+				sList = list[pNum*pSize:]
+			} else {
+				sList = list[pNum*pSize : (pNum+1)*pSize]
+			}
 		}
 
 		return map[string]interface{}{