From 7511b6b5cd57e6910998eb2955a7a96936b25c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=80=E5=B3=B0?= <1feng.0595@gmail.com> Date: Wed, 7 Jun 2017 18:46:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=EF=BC=8C=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Common/function.php | 6 +- .../Controllers/Admin/ArticleController.php | 4 +- .../Controllers/Admin/CategoryController.php | 19 +++- .../Admin/FriendlinkController.php | 2 +- app/Http/Controllers/Admin/MenuController.php | 83 ++++++++++++++++ .../Controllers/Admin/ProductController.php | 4 +- .../Admin/ProducttypeController.php | 20 +++- app/Http/Controllers/Admin/UserController.php | 72 +++++++++++++- .../Controllers/Admin/UserRoleController.php | 80 ++++++++++++++++ app/Http/Controllers/Home/IndexController.php | 8 +- resources/views/admin/article/add.blade.php | 4 +- resources/views/admin/article/edit.blade.php | 4 +- resources/views/admin/article/index.blade.php | 6 +- resources/views/admin/category/add.blade.php | 4 +- resources/views/admin/category/edit.blade.php | 2 +- .../views/admin/category/index.blade.php | 4 +- .../views/admin/common/leftmenu.blade.php | 7 +- .../views/admin/friendlink/index.blade.php | 2 +- .../views/admin/guestbook/index.blade.php | 2 +- resources/views/admin/keyword/index.blade.php | 2 +- resources/views/admin/menu/add.blade.php | 91 ++++++++++++++++++ resources/views/admin/menu/edit.blade.php | 95 +++++++++++++++++++ resources/views/admin/menu/index.blade.php | 30 ++++++ resources/views/admin/product/add.blade.php | 4 +- resources/views/admin/product/edit.blade.php | 8 +- resources/views/admin/product/index.blade.php | 6 +- .../views/admin/producttype/add.blade.php | 4 +- .../views/admin/producttype/edit.blade.php | 2 +- .../views/admin/producttype/index.blade.php | 2 +- .../views/admin/searchword/index.blade.php | 2 +- resources/views/admin/slide/index.blade.php | 2 +- .../views/admin/sysconfig/index.blade.php | 2 + resources/views/admin/tag/index.blade.php | 2 +- resources/views/admin/user/add.blade.php | 68 +++++++++++++ resources/views/admin/user/edit.blade.php | 83 +++++++++------- resources/views/admin/user/edit222.blade.php | 58 +++++++++++ resources/views/admin/user/index.blade.php | 24 ++++- resources/views/admin/userrole/add.blade.php | 65 +++++++++++++ resources/views/admin/userrole/edit.blade.php | 65 +++++++++++++ .../views/admin/userrole/index.blade.php | 30 ++++++ resources/views/home/common/header.blade.php | 4 +- resources/views/home/index/category.blade.php | 2 +- resources/views/home3/common/header.blade.php | 4 +- resources/views/home3/index/product.blade.php | 4 +- .../views/home3/index/productcat.blade.php | 6 +- routes/web.php | 37 ++++++-- 46 files changed, 921 insertions(+), 114 deletions(-) create mode 100644 app/Http/Controllers/Admin/MenuController.php create mode 100644 app/Http/Controllers/Admin/UserRoleController.php create mode 100644 resources/views/admin/menu/add.blade.php create mode 100644 resources/views/admin/menu/edit.blade.php create mode 100644 resources/views/admin/menu/index.blade.php create mode 100644 resources/views/admin/user/add.blade.php create mode 100644 resources/views/admin/user/edit222.blade.php create mode 100644 resources/views/admin/userrole/add.blade.php create mode 100644 resources/views/admin/userrole/edit.blade.php create mode 100644 resources/views/admin/userrole/index.blade.php diff --git a/app/Common/function.php b/app/Common/function.php index 581fab5..474ac1c 100644 --- a/app/Common/function.php +++ b/app/Common/function.php @@ -623,7 +623,7 @@ function get_category($modelname, $parent_id=0, $pad=0) { $arr=array(); - $temp = \DB::table($modelname)->where('reid', $parent_id)->orderBy('id', 'asc')->get(); + $temp = \DB::table($modelname)->where('pid', $parent_id)->orderBy('id', 'asc')->get(); $cats = object_to_array($temp); if($cats) @@ -649,11 +649,11 @@ function category_tree($list,$pid=0) { foreach($list as $v) { - $temp[] = array("id"=>$v['id'],"deep"=>$v['deep'],"typename"=>$v['typename'],"reid"=>$v['reid'],"typedir"=>$v['typedir'],"addtime"=>$v['addtime']); + $temp[] = array("id"=>$v['id'],"deep"=>$v['deep'],"name"=>$v['name'],"pid"=>$v['pid']); //echo $v['id']; if(array_key_exists("child",$v)) { - category_tree($v['child'],$v['reid']); + category_tree($v['child'],$v['pid']); } } } diff --git a/app/Http/Controllers/Admin/ArticleController.php b/app/Http/Controllers/Admin/ArticleController.php index 8e368d9..94b6ba7 100644 --- a/app/Http/Controllers/Admin/ArticleController.php +++ b/app/Http/Controllers/Admin/ArticleController.php @@ -39,8 +39,8 @@ class ArticleController extends CommonController $posts = parent::pageList('article', $where); foreach($posts as $key=>$value) { - $info = DB::table('arctype')->select('typename')->where("id", $value->typeid)->first(); - $posts[$key]->typename = $info->typename; + $info = DB::table('arctype')->select('name')->where("id", $value->typeid)->first(); + $posts[$key]->name = $info->name; $posts[$key]->body = ''; } diff --git a/app/Http/Controllers/Admin/CategoryController.php b/app/Http/Controllers/Admin/CategoryController.php index 0a2d4c3..d277ad3 100644 --- a/app/Http/Controllers/Admin/CategoryController.php +++ b/app/Http/Controllers/Admin/CategoryController.php @@ -13,7 +13,20 @@ class CategoryController extends CommonController public function index() { - return view('admin.category.index'); + $catlist = category_tree(get_category('arctype',0)); + + if($catlist) + { + foreach($catlist as $k=>$v) + { + $arctype = DB::table("arctype")->where('id', $v['id'])->first(); + $catlist[$k]['typedir'] = $arctype->typedir; + $catlist[$k]['addtime'] = $arctype->addtime; + } + } + + $data['catlist'] = $catlist; + return view('admin.category.index', $data); } public function add() @@ -39,7 +52,7 @@ class CategoryController extends CommonController public function doadd() { - if(!empty($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}}//父级栏目id + if(!empty($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['pid']=0;}else{$_POST['pid'] = $_POST["prid"];}}//父级栏目id $_POST['addtime'] = time();//添加时间 unset($_POST["prid"]); unset($_POST["_token"]); @@ -90,7 +103,7 @@ class CategoryController extends CommonController { if(!empty($_REQUEST["id"])){$id = $_REQUEST["id"];}else{error_jump('删除失败!请重新提交');} //if(preg_match('/[0-9]*/',$id)){}else{exit;} - if(DB::table('arctype')->where('reid', $id)->first()) + if(DB::table('arctype')->where('pid', $id)->first()) { error_jump('删除失败!请先删除子栏目'); } diff --git a/app/Http/Controllers/Admin/FriendlinkController.php b/app/Http/Controllers/Admin/FriendlinkController.php index c010635..01a770c 100644 --- a/app/Http/Controllers/Admin/FriendlinkController.php +++ b/app/Http/Controllers/Admin/FriendlinkController.php @@ -66,7 +66,7 @@ class FriendlinkController extends CommonController public function del() { - if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Friendlink' , 3);} //if(preg_match('/[0-9]*/',$id)){}else{exit;} + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} if(DB::table('friendlink')->whereIn("id", explode(',', $id))->delete()) { diff --git a/app/Http/Controllers/Admin/MenuController.php b/app/Http/Controllers/Admin/MenuController.php new file mode 100644 index 0000000..37535c9 --- /dev/null +++ b/app/Http/Controllers/Admin/MenuController.php @@ -0,0 +1,83 @@ +insert($_POST)) + { + success_jump('添加成功!', route('admin_menu')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } + } + + public function edit() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} + if(preg_match('/[0-9]*/',$id)){}else{exit;} + + $data['id'] = $id; + $data['post'] = object_to_array(DB::table('menu')->where('id', $id)->first(), 1); + $data['menu'] = category_tree(get_category('menu',0)); + + return view('admin.menu.edit', $data); + } + + public function doedit() + { + if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} + + unset($_POST["_token"]); + if(DB::table('menu')->where('id', $id)->update($_POST)) + { + success_jump('修改成功!', route('admin_menu')); + } + else + { + error_jump('修改失败!'); + } + } + + public function del() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} + + if(DB::table('menu')->whereIn("id", explode(',', $id))->delete()) + { + success_jump('删除成功'); + } + else + { + error_jump('删除失败!请重新提交'); + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index 8a4ab7d..3b4103c 100644 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -34,8 +34,8 @@ class ProductController extends CommonController $posts = parent::pageList('product', $where); foreach($posts as $key=>$value) { - $info = DB::table('product_type')->select('typename')->where("id", $value->typeid)->first(); - $posts[$key]->typename = $info->typename; + $info = DB::table('product_type')->select('name')->where("id", $value->typeid)->first(); + $posts[$key]->name = $info->name; $posts[$key]->body = ''; } diff --git a/app/Http/Controllers/Admin/ProducttypeController.php b/app/Http/Controllers/Admin/ProducttypeController.php index a170bd6..0a01cc8 100644 --- a/app/Http/Controllers/Admin/ProducttypeController.php +++ b/app/Http/Controllers/Admin/ProducttypeController.php @@ -13,8 +13,20 @@ class ProductTypeController extends CommonController public function index() { - $data['catlist'] = category_tree(get_category('product_type',0)); - return view('admin.producttype.index', $data); + $catlist = category_tree(get_category('product_type',0)); + + if($catlist) + { + foreach($catlist as $k=>$v) + { + $arctype = DB::table("arctype")->where('id', $v['id'])->first(); + $catlist[$k]['typedir'] = $arctype->typedir; + $catlist[$k]['addtime'] = $arctype->addtime; + } + } + + $data['catlist'] = $catlist; + return view('admin.producttype.index', $data); } public function add() @@ -41,7 +53,7 @@ class ProductTypeController extends CommonController public function doadd() { - if(isset($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}unset($_POST["prid"]);}//父级栏目id + if(isset($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['pid']=0;}else{$_POST['pid'] = $_POST["prid"];}unset($_POST["prid"]);}//父级栏目id $_POST['addtime'] = time();//添加时间 unset($_POST["_token"]); @@ -92,7 +104,7 @@ class ProductTypeController extends CommonController { if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} - if(DB::table("product_type")->where('reid', $id)->first()) + if(DB::table("product_type")->where('pid', $id)->first()) { error_jump('删除失败!请先删除子分类'); } diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 0ae840d..e929f17 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -13,18 +13,68 @@ class UserController extends CommonController public function index() { - return view('admin.user.index'); + $posts = parent::pageList('user'); + + $data['posts'] = $posts; + + return view('admin.user.index', $data); + } + + public function add() + { + $data['rolelist'] = object_to_array(DB::table('user_role')->orderBy('listorder','desc')->get()); + + return view('admin.user.add', $data); + } + + public function doadd() + { + unset($_POST["_token"]); + $_POST['pwd'] = md5($_POST['pwd']); + if(DB::table('user')->insert($_POST)) + { + success_jump('添加成功!', route('admin_user')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } } public function edit() { - $data['post'] = object_to_array(DB::table('user')->where('id', 1)->first(), 1); + if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} + if(preg_match('/[0-9]*/',$id)){}else{exit;} + $data['id'] = $id; + $data['post'] = object_to_array(DB::table('user')->where('id', $id)->first(), 1); + $data['rolelist'] = object_to_array(DB::table('user_role')->orderBy('listorder','desc')->get()); + return view('admin.user.edit', $data); } + + public function doedit() + { + if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} + + unset($_POST["_token"]); + $_POST['pwd'] = md5($_POST['pwd']); + if(DB::table('user')->where('id', $id)->update($_POST)) + { + success_jump('修改成功!', route('admin_user')); + } + else + { + error_jump('修改失败!'); + } + } - public function doedit() + //修改密码 + /* public function doedit() { + if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} + unset($_POST["_token"]); + if(!empty($_POST["username"])){$data['username'] = $map['username'] = $_POST["username"];}else{error_jump('用户名不能为空');exit;}//用户名 if(!empty($_POST["oldpwd"])){$map['pwd'] = md5($_POST["oldpwd"]);}else{error_jump('旧密码错误');exit;} if($_POST["newpwd"]==$_POST["newpwd2"]){$data['pwd'] = md5($_POST["newpwd"]);}else{error_jump('密码错误');exit;} @@ -34,7 +84,7 @@ class UserController extends CommonController if($User) { - if(DB::table('user')->where('id', 1)->update($data)) + if(DB::table('user')->where('id', $id)->update($data)) { session_unset(); session_destroy(); @@ -45,5 +95,19 @@ class UserController extends CommonController { error_jump('修改失败!旧用户名或密码错误'); } + } */ + + public function del() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} + + if(DB::table('user')->whereIn("id", explode(',', $id))->delete()) + { + success_jump('删除成功'); + } + else + { + error_jump('删除失败!请重新提交'); + } } } \ No newline at end of file diff --git a/app/Http/Controllers/Admin/UserRoleController.php b/app/Http/Controllers/Admin/UserRoleController.php new file mode 100644 index 0000000..56232fb --- /dev/null +++ b/app/Http/Controllers/Admin/UserRoleController.php @@ -0,0 +1,80 @@ +insert($_POST)) + { + success_jump('添加成功!', route('admin_userrole')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } + } + + public function edit() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} + if(preg_match('/[0-9]*/',$id)){}else{exit;} + + $data['id'] = $id; + $data['post'] = object_to_array(DB::table('user_role')->where('id', $id)->first(), 1); + + return view('admin.userrole.edit', $data); + } + + public function doedit() + { + if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} + + unset($_POST["_token"]); + if(DB::table('user_role')->where('id', $id)->update($_POST)) + { + success_jump('修改成功!', route('admin_userrole')); + } + else + { + error_jump('修改失败!'); + } + } + + public function del() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} + + if(DB::table('user_role')->whereIn("id", explode(',', $id))->delete()) + { + success_jump('删除成功'); + } + else + { + error_jump('删除失败!请重新提交'); + } + } +} diff --git a/app/Http/Controllers/Home/IndexController.php b/app/Http/Controllers/Home/IndexController.php index 6d6e8d6..a9e61a1 100644 --- a/app/Http/Controllers/Home/IndexController.php +++ b/app/Http/Controllers/Home/IndexController.php @@ -28,7 +28,7 @@ class IndexController extends CommonController $data['post'] = $post; $subcat="";$sql=""; - $post2 = object_to_array(DB::table('arctype')->select('id')->where('reid', $cat)->get()); + $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} $subcat=$subcat."typeid=".$cat; $sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit; @@ -59,7 +59,7 @@ class IndexController extends CommonController { if(empty($id) || !preg_match('/[0-9]+/',$id)){error_jump('您访问的页面不存在或已被删除!', route('page404'));} - if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}$post['typename'] = DB::table('arctype')->where('id', $post['typeid'])->value('typename');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} + if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} if($post) { $cat = $post['typeid']; @@ -197,7 +197,7 @@ class IndexController extends CommonController $data['post'] = $post; $subcat="";$sql=""; - $post2 = object_to_array(DB::table('product_type')->select('id')->where('reid', $cat)->get()); + $post2 = object_to_array(DB::table('product_type')->select('id')->where('pid', $cat)->get()); if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} $subcat=$subcat."typeid=".$cat; $data['sql'] = $subcat; @@ -226,7 +226,7 @@ class IndexController extends CommonController { if(empty($id) || !preg_match('/[0-9]+/',$id)){error_jump('您访问的页面不存在或已被删除!', route('page404'));} - $post = object_to_array(DB::table('product')->where('id', $id)->first(), 1);if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}$post['typename'] = DB::table('arctype')->where('id', $post['typeid'])->value('typename'); + $post = object_to_array(DB::table('product')->where('id', $id)->first(), 1);if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); if($post) { $cat = $post['typeid']; diff --git a/resources/views/admin/article/add.blade.php b/resources/views/admin/article/add.blade.php index 26df9ba..c8bacc8 100644 --- a/resources/views/admin/article/add.blade.php +++ b/resources/views/admin/article/add.blade.php @@ -75,9 +75,9 @@ function upImage() diff --git a/resources/views/admin/article/edit.blade.php b/resources/views/admin/article/edit.blade.php index 2cebaa0..d3de76c 100644 --- a/resources/views/admin/article/edit.blade.php +++ b/resources/views/admin/article/edit.blade.php @@ -76,9 +76,9 @@ function upImage() diff --git a/resources/views/admin/article/index.blade.php b/resources/views/admin/article/index.blade.php index baeaeb5..53c4bbc 100644 --- a/resources/views/admin/article/index.blade.php +++ b/resources/views/admin/article/index.blade.php @@ -23,7 +23,7 @@ title; ?> litpic)){echo "[图]";}if($row->tuijian==1){echo "[荐]";} ?> pubdate); ?> - typename; ?>click; ?>"content","catid"=>$row->typeid,"id"=>$row->id)); ?>">预览 修改 删除 + name; ?>click; ?>"content","catid"=>$row->typeid,"id"=>$row->id)); ?>">预览 修改 删除 @@ -40,12 +40,12 @@ -
{{ $posts->links() }}
+ + \ No newline at end of file diff --git a/resources/views/admin/menu/edit.blade.php b/resources/views/admin/menu/edit.blade.php new file mode 100644 index 0000000..fdd0dae --- /dev/null +++ b/resources/views/admin/menu/edit.blade.php @@ -0,0 +1,95 @@ +菜单修改_后台管理@include('admin.common.header') +
+
+ + +
+
菜单列表 > 菜单修改
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
上级: + +
名称:" class="required" style="width:30%" placeholder="在此输入菜单名称">
操作方法:" class="required" style="width:30%">
参数:" style="width:30%">
图标:" style="width:30%">
备注:" style="width:50%">
状态: + /> 显示   + /> 隐藏 +
状态: + /> 权限认证+菜单   + /> 只作为菜单 +
注意:“权限认证+菜单”表示加入后台权限管理,纯碎是菜单项请不要选择此项。 +
  
+
+ + + \ No newline at end of file diff --git a/resources/views/admin/menu/index.blade.php b/resources/views/admin/menu/index.blade.php new file mode 100644 index 0000000..1acbbff --- /dev/null +++ b/resources/views/admin/menu/index.blade.php @@ -0,0 +1,30 @@ +菜单管理_后台管理@include('admin.common.header') +
+
+ + +
+

菜单管理

[ 菜单添加 ]

+ +
+ + + + + + + + + + + + + + + +
ID菜单名称操作方法状态管理
id; ?>name; ?>action; ?>status==1){echo '显示';}else{echo '隐藏';} ?>修改 | 删除
+ + + +
+ \ No newline at end of file diff --git a/resources/views/admin/product/add.blade.php b/resources/views/admin/product/add.blade.php index 4def6e5..e3c1ca4 100644 --- a/resources/views/admin/product/add.blade.php +++ b/resources/views/admin/product/add.blade.php @@ -79,9 +79,9 @@ function upImage() diff --git a/resources/views/admin/product/edit.blade.php b/resources/views/admin/product/edit.blade.php index 0e860dc..98e93c5 100644 --- a/resources/views/admin/product/edit.blade.php +++ b/resources/views/admin/product/edit.blade.php @@ -24,8 +24,8 @@ 上架: - {if condition="$post['status']==0"}checked{/if} /> 是   - {if condition="$post['status']==1"}checked{/if} /> 否 + /> 是   + /> 否 @@ -80,9 +80,9 @@ function upImage() diff --git a/resources/views/admin/product/index.blade.php b/resources/views/admin/product/index.blade.php index adc4ae1..4a33fb7 100644 --- a/resources/views/admin/product/index.blade.php +++ b/resources/views/admin/product/index.blade.php @@ -23,7 +23,7 @@ title; ?> litpic)){echo "[图]";}if($row->tuijian==1){echo "[荐]";} ?> pubdate); ?> - typename; ?>click; ?>预览 修改 删除 + name; ?>click; ?>预览 修改 删除 @@ -40,12 +40,12 @@ -
{{ $posts->links() }}
+ + \ No newline at end of file diff --git a/resources/views/admin/user/edit.blade.php b/resources/views/admin/user/edit.blade.php index 0bdafea..e700721 100644 --- a/resources/views/admin/user/edit.blade.php +++ b/resources/views/admin/user/edit.blade.php @@ -1,58 +1,71 @@ -密码修改_后台管理@include('admin.common.header') +管理员修改_后台管理@include('admin.common.header')
- +
-

密码修改

-
{{ csrf_field() }} +
管理员列表 > 管理员修改
+ +{{ csrf_field() }} - + - - + + - - + + - - + + - +
用户名:" style="width:30%">" class="required" style="width:30%" placeholder="在此输入用户名">
旧密码:密码:
新密码:邮箱:" style="width:30%">
确认密码:角色: + +
    
+ \ No newline at end of file diff --git a/resources/views/admin/user/edit222.blade.php b/resources/views/admin/user/edit222.blade.php new file mode 100644 index 0000000..0bdafea --- /dev/null +++ b/resources/views/admin/user/edit222.blade.php @@ -0,0 +1,58 @@ +密码修改_后台管理@include('admin.common.header') +
+
+ + +
+

密码修改

+
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + +
用户名:" style="width:30%">
旧密码:
新密码:
确认密码:
  
+
+ + \ No newline at end of file diff --git a/resources/views/admin/user/index.blade.php b/resources/views/admin/user/index.blade.php index 3bda24d..5bfa7f7 100644 --- a/resources/views/admin/user/index.blade.php +++ b/resources/views/admin/user/index.blade.php @@ -1,12 +1,30 @@ -用户列表_后台管理@include('admin.common.header') +管理员列表_后台管理@include('admin.common.header')
-

用户管理

+

管理员列表

[ 添加管理员 ]

-修改密码 +
+ + + + + + + + + + + + + + + +
ID用户名邮箱状态管理
id; ?>username; ?>email; ?>status==0){echo '正常';}elseif($row->status==1){echo '禁用';}elseif($row->status==2){echo '禁用';} ?>权限设置 | 修改 | 删除
+ +
\ No newline at end of file diff --git a/resources/views/admin/userrole/add.blade.php b/resources/views/admin/userrole/add.blade.php new file mode 100644 index 0000000..70b166f --- /dev/null +++ b/resources/views/admin/userrole/add.blade.php @@ -0,0 +1,65 @@ +添加角色_后台管理@include('admin.common.header') +
+
+ + +
+
角色列表 > 添加角色
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + +
角色名称:
角色描述:
状态: +  是   +  否 +
排序:
  
+
+ + + \ No newline at end of file diff --git a/resources/views/admin/userrole/edit.blade.php b/resources/views/admin/userrole/edit.blade.php new file mode 100644 index 0000000..57d4786 --- /dev/null +++ b/resources/views/admin/userrole/edit.blade.php @@ -0,0 +1,65 @@ +角色修改_后台管理@include('admin.common.header') +
+
+ + +
+
角色列表 > 角色修改
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + +
角色名称:" class="required" style="width:30%" placeholder="在此输入角色名称">
角色描述:" style="width:60%">
状态: + /> 启用   + /> 禁用 +
排序:" style="width:60%">
  
+
+ + + \ No newline at end of file diff --git a/resources/views/admin/userrole/index.blade.php b/resources/views/admin/userrole/index.blade.php new file mode 100644 index 0000000..4cd6aba --- /dev/null +++ b/resources/views/admin/userrole/index.blade.php @@ -0,0 +1,30 @@ +角色管理_后台管理@include('admin.common.header') +
+
+ + +
+

角色管理

[ 添加角色 ]

+ +
+ + + + + + + + + + + + + + + +
ID角色名称角色描述状态管理
id; ?>name; ?>des; ?>status==0){echo '启用';}else{echo '禁用';} ?>权限设置 | 修改 | 删除
+ + + +
+ \ No newline at end of file diff --git a/resources/views/home/common/header.blade.php b/resources/views/home/common/header.blade.php index baf0b95..e2b532b 100644 --- a/resources/views/home/common/header.blade.php +++ b/resources/views/home/common/header.blade.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/resources/views/home/index/category.blade.php b/resources/views/home/index/category.blade.php index 1d81769..c608b8b 100644 --- a/resources/views/home/index/category.blade.php +++ b/resources/views/home/index/category.blade.php @@ -2,7 +2,7 @@ <?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?>" />" /> @include('home.common.header')
-

'.$post['content'].'
';} ?>
+

'.$post['content'].'
';} ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?> $row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>" target="_blank">

..

diff --git a/resources/views/home3/common/header.blade.php b/resources/views/home3/common/header.blade.php index baf0b95..e2b532b 100644 --- a/resources/views/home3/common/header.blade.php +++ b/resources/views/home3/common/header.blade.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/resources/views/home3/index/product.blade.php b/resources/views/home3/index/product.blade.php index bc12121..8ef5e70 100644 --- a/resources/views/home3/index/product.blade.php +++ b/resources/views/home3/index/product.blade.php @@ -62,7 +62,7 @@ $('.bxslider').bxSlider({
-

+

@@ -129,7 +129,7 @@ document.getElementById('price').innerHTML=(3000+sp0+sp1+sp2).toFixed(2);documen

栏目导航

    [['reid','=',0]], 'orderby'=>['sortrank', 'desc']]);if($posts){foreach($posts as $row){ ?> -
  • +
diff --git a/resources/views/home3/index/productcat.blade.php b/resources/views/home3/index/productcat.blade.php index 9746be7..f83b0bb 100644 --- a/resources/views/home3/index/productcat.blade.php +++ b/resources/views/home3/index/productcat.blade.php @@ -60,7 +60,7 @@ $('.bxslider').bxSlider({
-

+

  • title; ?>pubdate); ?>
  • @@ -73,8 +73,8 @@ $('.bxslider').bxSlider({

    栏目导航

      - [['reid','=',0]], 'orderby'=>['sortrank', 'desc']]);if($posts){foreach($posts as $row){ ?> -
    • + [['pid','=',0]], 'orderby'=>['sortrank', 'desc']]);if($posts){foreach($posts as $row){ ?> +
    diff --git a/routes/web.php b/routes/web.php index ab31b95..5cceb14 100644 --- a/routes/web.php +++ b/routes/web.php @@ -22,7 +22,7 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}', 'IndexController@tag'); //标签页 Route::get('/page/{id}', 'IndexController@singlepage')->name('wap_singlepage'); //单页 - Route::get('/sitemap.xml', 'IndexController@sitemap')->name('wap_sitemap'); //sitemap + Route::get('/sitemap.xml', 'IndexController@sitemap')->name('wap_sitemap'); //sitemap Route::get('/aaa', function () { dd('wap'); }); @@ -35,15 +35,15 @@ Route::group(['namespace' => 'Home'], function () { Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面 Route::get('/tags', 'IndexController@tags')->name('tags'); Route::get('/search', 'IndexController@search'); - Route::get('/p/{id}', 'IndexController@detail')->name('home_detail'); //详情页 + Route::get('/p/{id}', 'IndexController@detail')->name('home_detail'); //详情页 Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页 - Route::get('/cat{cat}', 'IndexController@category')->name('home_category'); //分类页 + Route::get('/cat{cat}', 'IndexController@category')->name('home_category'); //分类页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 - Route::get('/tag{tag}', 'IndexController@tag'); //标签页 + Route::get('/tag{tag}', 'IndexController@tag')->name('tag'); //标签页 Route::get('/page/{id}', 'IndexController@page')->name('singlepage'); //单页 - Route::get('/product/{id}', 'IndexController@product')->name('product'); //详情页 - Route::get('/productcat{cat}/{page}', 'IndexController@productcat'); //产品分类页,分页 - Route::get('/productcat{cat}', 'IndexController@productcat')->name('productcat'); //产品分类页 + Route::get('/product/{id}', 'IndexController@product')->name('product'); //详情页 + Route::get('/productcat{cat}/{page}', 'IndexController@productcat'); //产品分类页,分页 + Route::get('/productcat{cat}', 'IndexController@productcat')->name('productcat'); //产品分类页 Route::get('/sitemap.xml', 'IndexController@sitemap')->name('sitemap'); //sitemap Route::get('/aaa', function () { @@ -142,16 +142,33 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/sysconfig/edit', 'SysconfigController@edit')->name('admin_sysconfig_edit'); Route::post('/sysconfig/doedit', 'SysconfigController@doedit')->name('admin_sysconfig_doedit'); Route::get('/sysconfig/del', 'SysconfigController@del')->name('admin_sysconfig_del'); - //用户 + //用户管理 Route::get('/user', 'UserController@index')->name('admin_user'); + Route::get('/user/add', 'UserController@add')->name('admin_user_add'); + Route::post('/user/doadd', 'UserController@doadd')->name('admin_user_doadd'); Route::get('/user/edit', 'UserController@edit')->name('admin_user_edit'); Route::post('/user/doedit', 'UserController@doedit')->name('admin_user_doedit'); + Route::get('/user/del', 'UserController@del')->name('admin_user_del'); + //角色管理 + Route::get('/userrole', 'UserRoleController@index')->name('admin_userrole'); + Route::get('/userrole/add', 'UserRoleController@add')->name('admin_userrole_add'); + Route::post('/userrole/doadd', 'UserRoleController@doadd')->name('admin_userrole_doadd'); + Route::get('/userrole/edit', 'UserRoleController@edit')->name('admin_userrole_edit'); + Route::post('/userrole/doedit', 'UserRoleController@doedit')->name('admin_userrole_doedit'); + Route::get('/userrole/del', 'UserRoleController@del')->name('admin_userrole_del'); + //菜单管理 + Route::get('/menu', 'MenuController@index')->name('admin_menu'); + Route::get('/menu/add', 'MenuController@add')->name('admin_menu_add'); + Route::post('/menu/doadd', 'MenuController@doadd')->name('admin_menu_doadd'); + Route::get('/menu/edit', 'MenuController@edit')->name('admin_menu_edit'); + Route::post('/menu/doedit', 'MenuController@doedit')->name('admin_menu_doedit'); + Route::get('/menu/del', 'MenuController@del')->name('admin_menu_del'); //后台登录注销 Route::get('/login', 'LoginController@login')->name('admin_login'); - Route::post('/dologin', 'LoginController@dologin'); + Route::post('/dologin', 'LoginController@dologin')->name('admin_dologin'); Route::get('/logout', 'LoginController@logout')->name('admin_logout'); Route::get('/recoverpwd', 'LoginController@recoverpwd')->name('admin_recoverpwd'); - + //页面跳转 Route::get('/jump', 'LoginController@jump')->name('admin_jump'); });