From f67743e47f57dafc7031af44e2037c03e680a60c Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期一, 25 三月 2019 11:30:43 +0800
Subject: [PATCH] 清理无效引用

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java
index 3b13910..60b0dc0 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java
@@ -26,17 +26,6 @@
 	@Resource
 	private PushRecordService pushRecordService;
 	
-	@RequestMapping(value = "getPushRecordList", method = RequestMethod.POST)
-	public void getAll(String title,int type,int page,PrintWriter out){
-		List<PushRecord> list = pushRecordService.getPushRecordList(title,type,page);
-		int count = pushRecordService.getCount(title,type,page);
-		PageEntity pe = new PageEntity(page, Constant.PAGE_SIZE, count);
-		JSONObject data = new JSONObject();
-		data.put("pe", pe);
-		data.put("list", list);
-		out.print(JsonUtil.loadTrueResult(data));
-	}
-	
 	
 	/**
 	 * 鎺ㄨ崘璁板綍 -(鏂板悗鍙�)
@@ -64,9 +53,13 @@
 				return;
 			}
 			
-			int count = pushRecordService.getCount(key, type, pageIndex);
-			PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count);
+			int pageSize = Constant.PAGE_SIZE;
 			
+			int count = pushRecordService.getCount(key, type, pageIndex);
+			
+			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
+			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
+
 			JSONObject data = new JSONObject();
 			data.put("pe", pe);
 			data.put("result_list", list);

--
Gitblit v1.8.0