From dabb259bdecd9ace73a97b28d40f425a108aceab Mon Sep 17 00:00:00 2001
From: wangtengyu <wangtengyu>
Date: Fri, 14 Dec 2018 17:26:39 +0800
Subject: [PATCH] 用户列表调整 by 王腾宇

---
 application/admin/controller/UserList.php |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/application/admin/controller/UserList.php b/application/admin/controller/UserList.php
index 5c7bba5..65bbfc7 100644
--- a/application/admin/controller/UserList.php
+++ b/application/admin/controller/UserList.php
@@ -13,21 +13,34 @@
 
 class UserList extends Base
 {
+
     // 页面初始化
     public function _initialize()
     {}
 
     public function index()
     {
-        $retData = toPost($GLOBALS["user_list_path"],array(
-            "invitationCode"=>$GLOBALS["invitation_code"]
-        ),"1000001");
-        echo($retData);
-        $list = array();
-        if ($retData["rspCode"]==="e00000") {
-            $list = $retData["rspData"];
+        $param = I('get.');
+        $param['invitationCode'] = $GLOBALS['invitation_code'];
+        if ($param["min_date"] != null && $param["min_date"] != "") {
+            $param["min_date"] = strtotime($param["min_date"]);
         }
-        $this->assign('list',$list);
+        if ($param["max_date"] != null && $param["max_date"] != "") {
+            $param["max_date"] = strtotime($param["max_date"]);
+        }
+        $retData = toPost($GLOBALS["user_list_path"],$param,'1000001');
+        if ($retData["rspCode"]==="e00000") {
+            $this->assign('list',array_map(function ($row) {
+                $row["status"] = $row["status"] == "2"? "有效":"无效";
+                $row["joindate"] = date('Y-m-d H:i:s', $row["joindate"]);
+                $row["starttime"] = date('Y-m-d H:i:s', $row["starttime"]);
+                $row["endtime"] = $row["endtime"] == "0"? "永久有效":date('Y-m-d H:i:s', $row["endtime"]);  
+                return $row;
+            },$retData["rspData"]));
+        } else {
+            $this->assign('list',array());
+        }   
         return $this->fetch();
     }
+
 }
\ No newline at end of file

--
Gitblit v1.8.0