Commit 3479e4d2 authored by hujun's avatar hujun

测试用户列表

parent 15b1dd26
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th>注册时间</th> <th class="text-center">注册时间</th>
<th>用户ID</th> <th class="text-center">用户ID</th>
<th>昵称和头像</th> <th class="text-center">昵称和头像</th>
<th>手机号</th> <th class="text-center">手机号</th>
<th>邀请人</th> <th class="text-center">邀请人</th>
<th>操作</th> <th class="text-center">操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="users_list"> <tbody id="users_list" class="text-center">
</tbody> </tbody>
<!-- <tbody> <!-- <tbody>
...@@ -102,10 +102,7 @@ ...@@ -102,10 +102,7 @@
</tbody>--> </tbody>-->
</table> </table>
</div> </div>
</div> <!-- /#page-content-wrapper -->
</div>
</div>
<!-- /#page-content-wrapper -->
<div class="page-cla"> <div class="page-cla">
<ul class="pagination"> <ul class="pagination">
<li><a href="#">&laquo;</a></li> <li><a href="#">&laquo;</a></li>
...@@ -117,6 +114,10 @@ ...@@ -117,6 +114,10 @@
<li><a href="#">&raquo;</a></li> <li><a href="#">&raquo;</a></li>
</ul> </ul>
</div> </div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -41,11 +41,11 @@ class Users extends Model ...@@ -41,11 +41,11 @@ class Users extends Model
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
// dump($result);die;
// foreach ($result as $k=>$v) { foreach ($result as $k=>$v) {
// $data[$k] = $v->toArray(); $data[$k] = $v->toArray();
// } }
return $result; return $data;
} }
} }
...@@ -31,11 +31,9 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -31,11 +31,9 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
data: {}, data: {},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
console.log(data);
var temp = document.getElementById ('user_list_tpl').innerHTML; var temp = document.getElementById ('user_list_tpl').innerHTML;
var doTtmpl = doT.template (temp); var doTtmpl = doT.template (temp);
console.log(doTtmpl);
$ ("#users_list").append (doTtmpl (data)); $ ("#users_list").append (doTtmpl (data));
} }
}); });
......
<script id="user_list_tpl" type="text/template"> <script id="user_list_tpl" type="text/template">
[%= it.data.length %] [% if(it.data) { %]
[% for(var item in it.data){ %]
[%= it.data[0]["id"] %] <tr>
<td>[%= item["create_time"] %]</td>
<td>[%= item["id"] %]</td>
<td>[%= item["user_nick"] %][%= item["user_pic"] %]</td>
<td>[%= item["user_phone"] %]</td>
<td></td>
<td>
<a class="btn1 btn-success " href="#modal-do" data-toggle="modal">
编辑
</a>
<a class="btn1 btn-danger " href="#modal-delete" data-toggle="modal">
删除
</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="7" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment