From 8cd3418f8cd8d61493316db2b091c9c812d547dd Mon Sep 17 00:00:00 2001
From: chenl <461625388@qq.com>
Date: Fri, 28 Dec 2018 15:37:39 +0800
Subject: [PATCH] 代理商修改

---
 application/admin/controller/UserOrderList.php |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/application/admin/controller/UserOrderList.php b/application/admin/controller/UserOrderList.php
index 3e288cf..7a40169 100644
--- a/application/admin/controller/UserOrderList.php
+++ b/application/admin/controller/UserOrderList.php
@@ -10,22 +10,48 @@
 require dirname(__FILE__) . '/../conf/api_path.php';
 require dirname(__FILE__) . '/../conf/agent_conf.php';
 
+use think\Page;
+
 class UserOrderList extends Base
 {
     // 页面初始化
     public function _initialize()
-    {}
+    {
+        parent::_initialize();
+    }
 
     public function index()
     { 
-        $retData= toPost($GLOBALS['user_order_list_path'],array(
-            "invitationCode"=>$GLOBALS['invitation_code']
-        ),"1000001");
+        $param = I('get.');
+        $param['invitationCode'] = $GLOBALS['invitation_code'];
+        $listRows = config('paginate.list_rows');
+        $firstRow = $param['p'] > 0 ? ($param['p'] -1 ) * $listRows : 0;
+        $param['firstRow'] = $firstRow;
+        $param['listRows'] = $listRows;
+        $retData= toPost($GLOBALS['user_order_list_path'], $param,"1000001");
         $list = array();
         if ($retData["rspCode"]==="e00000") {
-            $list = $retData["rspData"];
+            $count = $retData["rspData"]["count"];
+            $Page = new Page($count, config('paginate.list_rows'));// 实例化分页类 传入总记录数和每页显示的记录数
+            $list = $retData["rspData"]["list"];
+        } else {
+            $Page = new Page(0, config('paginate.list_rows'));
         }
+        
+        $show = $Page->show();// 分页显示输出
+        $this->assign('page',$show);// 赋值分页输出
+        $this->assign('list',$list);// 赋值数据集
+        $this->assign('pager',$Page);// 赋值分页对象
+        
+        // 代理商名
+        if (!empty($param['agentName'])) {
+            $this->assign('agentName', $param['agentName']);
+        }
+        
         $this->assign('list',$list);
+        if (!empty($param['uuid'])) {
+            $this->assign('uuid', $param['uuid']);
+        }
         return $this->fetch();
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0