Browse Source

commit info

superbee315 5 years ago
parent
commit
8864ae7c59

+ 2 - 2
application/base/controller/Base.php

@@ -43,8 +43,8 @@ class Base extends Controller{
 		$rule_name = '/'.$m.'/'.$c.'/'.$a;
 		
 		$auth = new Auth();
-		$id = session('admin')['id'];
-		$result = $auth->check($rule_name, $id);
+		$admin = session('admin');
+		$result = $auth->check($rule_name, $admin['id']);
 // 		if(!$result){
 // 			$this->error('您没有权限访问');
 // 		}		

+ 36 - 45
application/base/view/login/login.html

@@ -1,46 +1,37 @@
-<!DOCTYPE html>
-<html lang="en" class="no-js">
-
-    <head>
-
-        <meta charset="utf-8">
-        <title>Login</title>
-        <meta name="viewport" content="width=device-width, initial-scale=1.0">
-        <meta name="description" content="">
-        <meta name="author" content="">
-
-        <!-- CSS -->
-        <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=PT+Sans:400,700'>
-        {css href="__ROOT__/__CSS__/reset.css" /}
-        {css href="__ROOT__/__CSS__/supersized.css" /}
-        {css href="__ROOT__/__CSS__/style.css" /}
-
-    </head>
-
-    <body>
-
-        <div class="page-container">
-            <h1>登录</h1>
-            <form action="__URL__/login" method="post">
-                <input type="text" name="username" class="username" placeholder="用户名" />
-                <input type="password" name="password" class="password" placeholder="密码" />
-                <button type="submit">Sign</button>
-                <div class="error"><span>+</span></div>
-            </form>
-            <div class="connect">
-                <p>Or connect with:</p>
-                <p>
-                    <a class="facebook" href=""></a>
-                    <a class="twitter" href=""></a>
-                </p>
-            </div>
-        </div>
-
-        <!-- Javascript -->
-        {js href="__ROOT__/__JS__/jquery-1.8.2.min.js"}
-        {js href="__ROOT__/__JS__/supersized.3.2.7.min.js"}
-        {js href="__ROOT__/__JS__/login.js"}
-
-    </body>
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Login</title>
+{css href="__ROOT__/__CSS__/style.css" /}
+{css href="__ROOT__/__CSS__/body.css" /}
+</head>
+<body>
+<div class="container">
+	<section id="content">
+		<form action="__URL__/login" method="post">
+			<h1>会员登录</h1>
+			<div>
+				<input type="text" name="username" id="username" placeholder="用户名" />
+			</div>
+			<div>
+				<input type="password" id="password" name="password" placeholder="密码" />
+			</div>
+			<div>
+				<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>			
+			</div> 
+			<div>
+				<input type="submit" value="登录" class="btn btn-primary" id="js-btn-login"/>
+				<a href="#">忘记密码?</a>
+				<!-- <a href="#">Register</a> -->
+			</div>
+		</form><!-- form -->
+		<div class="button">
+			<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>
+			<a href="#">Power By DashGame</a>	
+		</div> <!-- button -->
+	</section><!-- content -->
+</div>
+<!-- container -->
+</body>
 </html>

+ 0 - 5
application/index/controller/Index.php

@@ -10,9 +10,4 @@ class Index extends Base
     	
     	return $this->fetch();
     }
-    
-    
-    public function hello(){
-    	echo "hello ";
-    }
 }

+ 59 - 0
application/user/controller/Notice.php

@@ -0,0 +1,59 @@
+<?php
+namespace app\user\controller;
+
+use app\base\controller\Base;
+
+class Notice extends Base{
+	
+	private $noticeModel;
+	
+	public function _initialize(){
+		parent::_initialize();
+		
+		$this->noticeModel = new \app\user\model\Notice();
+	}
+	
+	public function index(){
+		$p = $this->request->get('page', 0);
+		$nick = $this->request->get('n');
+		$where = [];
+		
+		if($nick) $where['title'] = ['like', "%$nick%"];
+		
+		$info = $this->noticeModel->getInfo($p, $where);
+		$page = $this->noticeModel->getPage($where);
+		
+		$this->assign("info", $info);
+		$this->assign("page", $page);
+		return $this->fetch();
+	}
+	
+	public function edit(){
+		$id = $this->request->get('id');
+		$info = $this->noticeModel->getNoticeById($id);
+		
+		$this->assign("info", $info);
+		return $this->fetch('edit');
+	}
+	
+	public function delete(){
+		$res = $this->noticeModel->where(['id'=>$this->request->get('id')])->delete();
+		
+		if($res){
+			$this->success('删除成功!', 'index');
+		}else{
+			$this->error('删除失败!');
+		}
+	}
+	
+	public function save(){
+		$res = $this->noticeModel->addAndSave();
+		
+		if($res){
+			$this->success('保存成功!', 'index');
+		}else{
+			$this->error('保存失败!');
+		}
+	}
+	
+}

+ 49 - 0
application/user/controller/User.php

@@ -0,0 +1,49 @@
+<?php
+namespace app\user\controller;
+
+use app\base\controller\Base;
+
+class User extends Base{
+	
+	private $userModel;
+	
+	public function _initialize(){
+		parent::_initialize();
+		
+		$this->userModel = new \app\user\model\User();
+	}
+	
+	public function index(){
+		$p = $this->request->get('page', 0);
+		$nick = $this->request->get('n');
+		$where = [];
+		
+		if($nick) $where['nickname'] = ['like', "%$nick%"];
+		
+		$info = $this->userModel->getInfo($p, $where);
+		$page = $this->userModel->getPage($where);
+		
+		$this->assign("info", $info);
+		$this->assign("page", $page);
+		return $this->fetch();
+	}
+	
+	public function edit(){
+		$id = $this->request->get('id');
+		$info = $this->adminModel->getAdminById($id);
+		
+		$this->assign("info", $info);
+		return $this->fetch('edit');
+	}
+	
+	public function save(){
+		$res = $this->adminModel->addAndSave();
+		
+		if($res){
+			$this->success('保存成功!', 'index');
+		}else{
+			$this->error('保存失败!');
+		}
+	}
+	
+}

+ 1 - 1
application/user/model/Admin.php

@@ -118,7 +118,7 @@ class Admin extends Model{
 	
 	/**
 	 * 重置密码
-	 * @return Ambigous <string, int>
+	 * @return object Ambigous <string, int>
 	 */
 	public function resetPwd(){
 		$rule = [

+ 55 - 0
application/user/model/Notice.php

@@ -0,0 +1,55 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+class Notice extends Model{
+	
+	protected $autoWriteTimestamp = 'datetime';		// 开启自动写入时间戳字段
+	protected $createTime = 'create_time';			// 创建时间
+	protected $updateTime = 'update_time';			// 每次更新时间
+	
+	public function initialize(){
+		parent::initialize();
+	}
+	
+	/**
+	 * 获取数据信息
+	 * @param int $page 页码
+	 * @param array $where 查询条件
+	 */
+	public function getInfo($page = 0, $where = array()){
+		return $this->db()
+		->where($where)
+		->page($page, config('paginate.list_rows'))
+		->select();
+	}
+	
+	/**
+	 * 获取分页信息
+	 * @param array $where 查询条件
+	 */
+	public function getPage($where = array()){
+		$total = $this->db()->count();
+		$paginate = $this->db()->where($where)->paginate(config('paginate.list_rows'), $total);
+		
+		return $paginate->render();
+	}
+	
+	/**
+	 * 根据id找到对象
+	 * @param int $id
+	 */
+	public function getNoticeById($id){
+		return $this->db()->where(['id'=>$id])->find();
+	}
+	
+	/**
+	 * 添加和更新的方法
+	 */
+	public function addAndSave(){
+		$data = request()->post();
+		return $this->allowField(true)->isUpdate(isset($data['id']) && $data['id']?true:false)->save($data);
+	}
+	
+}

+ 1 - 1
application/user/model/PayPlugin.php

@@ -41,7 +41,7 @@ class PayPlugin extends Model{
 	/**
 	 * 根据id找到支付信息
 	 * @param int $id
-	 * @return array|\think\db\false|PDOStatement|string|\think\Model
+	 * @return array|string|\think\Model
 	 */
 	public function getPayPluginById($id){
 		return $this->db()->where(['id'=>$id])->find();

+ 1 - 1
application/user/model/RoleRule.php

@@ -29,7 +29,7 @@ class RoleRule extends Model{
 	
 	/**
 	 * 根据id找到规则
-	 * @param unknown $aid
+	 * @param int $aid
 	 */
 	public function getRidByAid($aid){
 		$array = [];

+ 4 - 4
application/user/model/User.php

@@ -89,7 +89,7 @@ class User extends Model{
 	/**
 	 * 用户登录
 	 * @param string $uid
-	 * @return Ambigous <i:id, c:int, d:int>
+	 * @return array Ambigous <i:id, c:int, d:int>
 	 */
 	public function loginByUid($uid){
 		$this->data['uid'] = $uid;
@@ -174,7 +174,7 @@ class User extends Model{
 	/**
 	 * 创建用户
 	 * @param string $uid
-	 * @return 返回用户数据库id
+	 * @return int 返回用户数据库id
 	 */
 	public function createUser($uid){
 		$data = ['id'=>getId(), 'uid'=>$uid];
@@ -230,7 +230,7 @@ class User extends Model{
 	/**
 	 * 获取近期注册机器人id
 	 * @param number $limit
-	 * @return \think\Collection|\think\db\false|PDOStatement|string
+	 * @return \think\Collection|string
 	 */
 	public function getRobotId($limit = 1){
 		return $this->db()->field("id i")->where(['robot'=>1])->order('registertime DESC')->limit($limit)->select();
@@ -251,7 +251,7 @@ class User extends Model{
 	
 	/**
 	 * 根据昵称模糊查找用户
-	 * @param unknown $nick
+	 * @param string $nick
 	 */
 	public function likeUserByNick($user, $nick){
 		$sql = "SELECT id i, nickname n, last_login t FROM `gd_user` WHERE `nickname` LIKE '%$nick%' AND id != $user AND nickname != '' AND robot = 0 AND id NOT IN (SELECT `buddy_id` FROM `gd_user_buddy` WHERE user_id = $user AND `status` = 1);";

+ 2 - 2
application/user/model/UserBuddy.php

@@ -15,7 +15,7 @@ class UserBuddy extends Model {
 	/**
 	 * 查找好友列表
 	 * @param int $user
-	 * @return array|\think\db\false|PDOStatement|string|\think\Model
+	 * @return array|string|\think\Model
 	 */
 	public function findUserBuddy($user, $status = UserBuddy::Friend){
 		return $this->db()->alias("b")
@@ -29,7 +29,7 @@ class UserBuddy extends Model {
 	 * 找到好友
 	 * @param int $user
 	 * @param int $buddy
-	 * @return array|\think\db\false|PDOStatement|string|\think\Model
+	 * @return array|string|\think\Model
 	 */
 	public function getBuddy($user, $buddy){
 		return $this->db()->where(['user_id'=>$user, 'buddy_id'=>$buddy])->find();

+ 1 - 1
application/user/model/UserPraise.php

@@ -27,7 +27,7 @@ class UserPraise extends Model{
 	/**
 	 * 查找制定目标数据
 	 * @param int $target
-	 * @return array|\think\db\false|PDOStatement|string|\think\Model
+	 * @return array|string|\think\Model
 	 */
 	public function getTargetInfo($user, $target){
 		return $this->db()->where(['user_id'=>$user, 'target_id'=>$target])->find();

+ 0 - 19
application/user/view/index/edit.html

@@ -6,25 +6,6 @@
 
       <div class="am-g">
         <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
-          <div class="am-panel am-panel-default">
-            <div class="am-panel-bd">
-              <div class="am-g">
-                <div class="am-u-md-4">
-                  <img class="am-img-circle am-img-thumbnail" src="http://s.amazeui.org/media/i/demos/bw-2014-06-19.jpg?imageView/1/w/200/h/200/q/80" alt=""/>
-                </div>
-                <div class="am-u-md-8">
-                  <p>你可以使用<a href="#">gravatar.com</a>提供的头像或者使用本地上传头像。 </p>
-                  <form class="am-form">
-                    <div class="am-form-group">
-                      <input type="file" id="user-pic">
-                      <p class="am-form-help">请选择要上传的文件...</p>
-                      <button type="button" class="am-btn am-btn-primary am-btn-xs">保存</button>
-                    </div>
-                  </form>
-                </div>
-              </div>
-            </div>
-          </div>
 
           <div class="am-panel am-panel-default">
             <div class="am-panel-bd">

+ 2 - 0
application/user/view/index/index.html

@@ -57,10 +57,12 @@
 		                <td>
 		                  <div class="am-btn-toolbar">
 		                    <div class="am-btn-group am-btn-group-xs">
+		                      {if condition="$v.name neq 'admin'"}
 		                      <button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="location.href='edit?id={$v.id}'"><span class="am-icon-pencil-square-o"></span> 编辑</button>
 		                      <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only" onclick="location.href='reset?id={$v.id}'"><span class="am-icon-copy"></span> 重置密码</button>
 		                      <button class="am-btn am-btn-default am-btn-xs am-text-warning am-hide-sm-only" onclick="location.href='group?id={$v.id}'"><span class="am-icon-tv"></span> 分配角色</button>
 		                      <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="if(confirm('确定要删除?'))location.href='delete?id={$v.id}'"><span class="am-icon-trash-o"></span> 删除</button>
+		                      {/if}
 		                    </div>
 		                  </div>
 		                </td>

+ 42 - 0
application/user/view/notice/edit.html

@@ -0,0 +1,42 @@
+{js href="__ROOT__/__JS__/ueditor/ueditor.config.js" /}
+{js href="__ROOT__/__JS__/ueditor/ueditor.all.min.js" /}
+{js href="__ROOT__/__JS__/ueditor/lang/zh-cn/zh-cn.js" /}
+
+	<div class="am-cf am-padding am-padding-bottom-0">
+        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">个人资料</strong> / <small>Personal information</small></div>
+    </div>
+
+      <hr/>
+
+      <div class="am-g">
+
+        <div class="am-u-sm-12 am-u-md-10">
+          <form class="am-form am-form-horizontal" method="post" action="save">
+          <input type="hidden" value="{$info.id}" name="id" />
+            <div class="am-form-group">
+              <label for="title" class="am-u-sm-3 am-form-label">标题 / Title</label>
+              <div class="am-u-sm-9">
+                <input type="text" id="title" name="title" value="{$info.title}" placeholder="标题 / Title">
+              </div>
+            </div>
+            
+            <div class="am-form-group">
+              <label for="content" class="am-u-sm-3 am-form-label">内容 / Content</label>
+              <div class="am-u-sm-9">
+              	<textarea id="content" name="content" rows="5" placeholder="内容 / Content">{$info.content}</textarea>
+              </div>
+            </div>
+            
+            <div class="am-form-group">
+              <div class="am-u-sm-9 am-u-sm-push-3">
+                <button type="submit" class="am-btn am-btn-primary">保存修改</button>
+               	<button type="button" class="am-btn am-btn-default" onclick="location.href='index'">返回</button>
+              </div>
+            </div>
+          </form>
+        </div>
+      </div>
+      
+<script type="text/javascript">
+    var ue = UE.getEditor('content');
+</script>

+ 80 - 0
application/user/view/notice/index.html

@@ -0,0 +1,80 @@
+	<div class="am-cf am-padding am-padding-bottom-0">
+        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">公告列表</strong> / <small>Notice</small></div>
+      </div>
+
+      <hr>
+
+      <div class="am-g">
+        <div class="am-u-sm-12 am-u-md-4">
+          <div class="am-btn-toolbar">
+            <div class="am-btn-group am-btn-group-xs">
+              <button type="button" class="am-btn am-btn-success" onclick="location.href='edit'"><span class="am-icon-plus"></span> 新增</button>
+            </div>
+          </div>
+        </div>
+        
+        <form class="am-form" action="index" method="get">
+	        
+	        <div class="am-u-sm-12 am-u-md-3">
+	          <div class="am-input-group am-input-group-sm">
+		          <input type="text" class="am-form-field" name="n" />
+		            
+		          <span class="am-input-group-btn">
+		            <button class="am-btn am-btn-default" type="submit">搜索</button>
+		          </span>
+	          </div>
+	        </div>
+	        
+	        <div class="am-u-sm-12 am-u-md-3">
+	          <div class="am-form-group">
+	          </div>
+	        </div>
+        </form>
+      </div>
+
+      <div class="am-g">
+        <div class="am-u-sm-12">
+          
+            <table class="am-table am-table-striped am-table-hover table-main">
+              <thead>
+	              <tr>
+	                <th class="table-id">序号</th>
+	                <th class="table-title">标题</th>
+	                <th class="table-date am-hide-sm-only">创建日期</th>
+	                <th class="table-date am-hide-sm-only">更新日期</th>
+	                <th class="table-set">操作</th>
+	              </tr>
+              </thead>
+              <tbody>
+              	{foreach name="info" key="k" item="v"}
+		              <tr>
+		                <td>{$k+1}</td>
+		                <td>{$v.title}</td>
+		                <td class="am-hide-sm-only">{$v.create_time}</td>
+		                <td class="am-hide-sm-only">{$v.update_time}</td>
+		                <td>
+		                  <div class="am-btn-toolbar">
+		                    <div class="am-btn-group am-btn-group-xs">
+		                      <button class="am-btn am-btn-default am-btn-xs am-text-secondary" 
+		                      	onclick="location.href='edit?id={$v.id}'">
+		                      	<span class="am-icon-pencil-square-o"></span> 编辑
+	                      	   </button>
+		                      <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" 
+		                      	onclick="if(confirm('确定要删除?'))location.href='delete?id={$v.id}'">
+		                      	<span class="am-icon-trash-o"></span> 删除
+		                      </button>
+		                    </div>
+		                  </div>
+		                </td>
+		              </tr>
+		          {/foreach}    
+              </tbody>
+            </table>
+            <div class="am-cf">
+              	{$page}
+            </div>
+            <hr />
+            <p>注:.....</p>
+        </div>
+   </div> 
+        

+ 82 - 0
application/user/view/user/index.html

@@ -0,0 +1,82 @@
+	<div class="am-cf am-padding am-padding-bottom-0">
+        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">用户列表</strong> / <small>User</small></div>
+      </div>
+
+      <hr>
+
+      <div class="am-g">
+        <div class="am-u-sm-12 am-u-md-4">
+          <div class="am-btn-toolbar">
+            <div class="am-btn-group am-btn-group-xs">
+              <button type="button" class="am-btn am-btn-success" onclick="location.href='edit'"><span class="am-icon-plus"></span> 新增</button>
+            </div>
+          </div>
+        </div>
+        
+        <form class="am-form" action="index" method="get">
+	        
+	        <div class="am-u-sm-12 am-u-md-3">
+	          <div class="am-input-group am-input-group-sm">
+		          <input type="text" class="am-form-field" name="n" />
+		            
+		          <span class="am-input-group-btn">
+		            <button class="am-btn am-btn-default" type="submit">搜索</button>
+		          </span>
+	          </div>
+	        </div>
+	        
+	        <div class="am-u-sm-12 am-u-md-3">
+	          <div class="am-form-group">
+	          </div>
+	        </div>
+        </form>
+      </div>
+
+      <div class="am-g">
+        <div class="am-u-sm-12">
+          
+            <table class="am-table am-table-striped am-table-hover table-main">
+              <thead>
+	              <tr>
+	                <th class="table-id">序号</th>
+	                <th>用户id</th>
+	                <th>昵称</th>
+	                <th>受赞数</th>
+	                <th>短码</th>
+	                <th class="table-date am-hide-sm-only">注册时间</th>
+	                <th class="table-date am-hide-sm-only">最后登录IP</th>
+	                <th class="table-date am-hide-sm-only">最后登录时间</th>
+	                <th class="table-set">操作</th>
+	              </tr>
+              </thead>
+              <tbody>
+              	{foreach name="info" key="k" item="v"}
+		              <tr>
+		                <td>{$k+1}</td>
+		                <td>{$v.uid}</td>
+		                <td>{$v.nickname}</td>
+		                <td>{$v.praise}</td>
+		                <td>{$v.short}</td>
+		                <td class="am-hide-sm-only">{$v.registertime}</td>
+		                <td class="am-hide-sm-only">{$v.last_ip}</td>
+		                <td class="am-hide-sm-only">{$v.last_login}</td>
+		                <td>
+		                  <div class="am-btn-toolbar">
+		                    <div class="am-btn-group am-btn-group-xs">
+		                      <button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="location.href='edit?id={$v.id}'"><span class="am-icon-pencil-square-o"></span> 编辑</button>
+		                      <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="if(confirm('确定要删除?'))location.href='delete?id={$v.id}'"><span class="am-icon-trash-o"></span> 删除</button>
+		                    </div>
+		                  </div>
+		                </td>
+		              </tr>
+		          {/foreach}    
+              </tbody>
+            </table>
+            <div class="am-cf">
+              	{$page}
+            </div>
+            <hr />
+            <p>注:.....</p>
+        </div>
+   </div> 
+        

+ 2 - 2
template/header.html

@@ -15,7 +15,7 @@
   {css href="__ROOT__/__CSS__/amazeui.min.css" /}
   {css href="__ROOT__/__CSS__/admin.css" /}
   {css href="__ROOT__/__CSS__/app.css" /}
-  {js href="__ROOT__/__JS__/jquery-3.1.1.min.js" /}
+  {js href="__ROOT__/__JS__/jquery.min.js" /}
 </head>
 <body>
 <!--[if lte IE 9]>
@@ -25,7 +25,7 @@
 
 <header class="am-topbar am-topbar-inverse admin-header">
   <div class="am-topbar-brand">
-    <strong>Amaze UI</strong> <small>后台管理模板</small>
+    <strong>Garden Admin</strong> <small>后台管理模板</small>
   </div>
 
   <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

+ 17 - 13
template/menu.html

@@ -2,18 +2,28 @@
   <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
     <div class="am-offcanvas-bar admin-offcanvas-bar">
       <ul class="am-list admin-sidebar-list">
-        <li><a href="admin-index.html"><span class="am-icon-home"></span> 首页</a></li>
+        <li><a href="{$rootpath}/user/index/index"><span class="am-icon-home"></span> 管理员列表</a></li>
         <li class="admin-parent">
-          <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span> 页面模块 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
+          <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}">
+          	<span class="am-icon-file"></span> 用户信息 <span class="am-icon-angle-right am-fr am-margin-right"></span>
+          </a>
           <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
-            <li><a href="#" class="am-cf"><span class="am-icon-check"></span> 个人资料<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
-            <li><a href="#"><span class="am-icon-puzzle-piece"></span> 帮助页</a></li>
-            <li><a href="#"><span class="am-icon-th"></span> 相册页面<span class="am-badge am-badge-secondary am-margin-right am-fr">24</span></a></li>
-            <li><a href="#"><span class="am-icon-calendar"></span> 系统日志</a></li>
+            <li>
+            	<a href="{$rootpath}/user/user/index" class="am-cf">
+            		<span class="am-icon-table"></span> 用户列表
+            		<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span>
+           		</a>
+           	</li>
+            <li>
+            	<a href="{$rootpath}/user/notice/index">
+            		<span class="am-icon-th"></span> 公告管理
+            		<span class="am-badge am-badge-secondary am-margin-right am-fr">24</span>
+           		</a>
+          	</li>
+            <li><a href="#"><span class="am-icon-calendar"></span> 邮件日志</a></li>
             <li><a href="#"><span class="am-icon-bug"></span> 404</a></li>
           </ul>
         </li>
-        <li><a href="#"><span class="am-icon-table"></span> 表格</a></li>
         <li><a href="#"><span class="am-icon-pencil-square-o"></span> 表单</a></li>
         <li><a href="{$rootpath}/base/login/out"><span class="am-icon-sign-out"></span> 注销</a></li>
       </ul>
@@ -25,12 +35,6 @@
         </div>
       </div>
 
-      <div class="am-panel am-panel-default admin-sidebar-panel">
-        <div class="am-panel-bd">
-          <p><span class="am-icon-tag"></span> wiki</p>
-          <p>Welcome to the Amaze UI wiki!</p>
-        </div>
-      </div>
     </div>
   </div>
   <!-- sidebar end -->

+ 6 - 1
thinkphp/library/think/db/Query.php

@@ -709,7 +709,12 @@ class Query
     {
         // 传入的表名为数组
         if (is_array($join)) {
-            list($table, $alias) = each($join);
+            // 再php7+版本以上,each()方法被废除
+            // list($table, $alias) = each($join);
+        	foreach ($join as $key=>$val){
+	            $table = $key;
+	            $alias = $val;
+        	}
         } else {
             $join = trim($join);
             if (false !== strpos($join, '(')) {