From 7c38cb92e5661bdbd6c507589136ec94f75e037f 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: Thu, 1 Jun 2017 19:51:48 +0800 Subject: [PATCH] home --- app/Common/function.php | 63 ++++-- .../Controllers/Admin/ProductController.php | 138 ++++++------ .../Admin/ProducttypeController.php | 76 ++++--- app/Http/Controllers/Home/IndexController.php | 197 +++++++++++++++++- app/Http/Model/Arctype.php | 1 - app/Http/Model/Friendlink.php | 14 ++ app/Http/Model/Guestbook.php | 14 ++ app/Http/Model/Keyword.php | 14 ++ app/Http/Model/Page.php | 14 ++ app/Http/Model/Product.php | 43 ++++ app/Http/Model/ProductPic.php | 13 ++ app/Http/Model/ProductType.php | 26 +++ app/Http/Model/Searchword.php | 35 ++++ app/Http/Model/Slide.php | 12 ++ app/Http/Model/Sysconfig.php | 2 + app/Http/Model/Tagindex.php | 35 ++++ app/Http/Model/Taglist.php | 12 ++ app/Http/Model/User.php | 2 + app/Http/Model/UserRole.php | 2 + .../views/admin/common/leftmenu.blade.php | 2 +- resources/views/admin/product/add.blade.php | 16 +- resources/views/admin/product/edit.blade.php | 36 ++-- resources/views/admin/product/index.blade.php | 28 +-- .../views/admin/producttype/add.blade.php | 95 +++------ .../views/admin/producttype/edit.blade.php | 115 ++++------ .../views/admin/producttype/index.blade.php | 12 +- resources/views/home/common/footer.blade.php | 1 + resources/views/home/common/header.blade.php | 1 + resources/views/home/index/category.blade.php | 62 ++++++ .../views/home/index/category2.blade.php | 57 +++++ resources/views/home/index/detail.blade.php | 60 ++++++ resources/views/home/index/index.blade.php | 70 +++++++ resources/views/home/index/login.blade.php | 171 +++++++++++++++ resources/views/home/index/page.blade.php | 8 + resources/views/home/index/search.blade.php | 35 ++++ resources/views/home/index/sitemap.blade.php | 9 + resources/views/home/index/tag.blade.php | 62 ++++++ resources/views/home/index/tag2.blade.php | 58 ++++++ resources/views/home/index/tag3.blade.php | 57 +++++ resources/views/home/index/tags.blade.php | 7 + routes/web.php | 49 +++-- 41 files changed, 1393 insertions(+), 331 deletions(-) create mode 100644 app/Http/Model/Friendlink.php create mode 100644 app/Http/Model/Guestbook.php create mode 100644 app/Http/Model/Keyword.php create mode 100644 app/Http/Model/Page.php create mode 100644 app/Http/Model/Product.php create mode 100644 app/Http/Model/ProductPic.php create mode 100644 app/Http/Model/ProductType.php create mode 100644 app/Http/Model/Searchword.php create mode 100644 app/Http/Model/Slide.php create mode 100644 app/Http/Model/Tagindex.php create mode 100644 app/Http/Model/Taglist.php create mode 100644 resources/views/home/common/footer.blade.php create mode 100644 resources/views/home/common/header.blade.php create mode 100644 resources/views/home/index/category.blade.php create mode 100644 resources/views/home/index/category2.blade.php create mode 100644 resources/views/home/index/detail.blade.php create mode 100644 resources/views/home/index/index.blade.php create mode 100644 resources/views/home/index/login.blade.php create mode 100644 resources/views/home/index/page.blade.php create mode 100644 resources/views/home/index/search.blade.php create mode 100644 resources/views/home/index/sitemap.blade.php create mode 100644 resources/views/home/index/tag.blade.php create mode 100644 resources/views/home/index/tag2.blade.php create mode 100644 resources/views/home/index/tag3.blade.php create mode 100644 resources/views/home/index/tags.blade.php diff --git a/app/Common/function.php b/app/Common/function.php index 0ba542d..309204a 100644 --- a/app/Common/function.php +++ b/app/Common/function.php @@ -113,24 +113,59 @@ function get_wap_front_url(array $param) */ function arclist(array $param) { - $map=array(); - - if(isset($param['tuijian'])){$map['tuijian']=$param['tuijian'];} - if(isset($param['typeid'])){$map['typeid']=$param['typeid'];} - if(isset($param['image'])){$map['litpic']=array('NEQ','');} - if(isset($param['limit'])){$limit=$param['limit'];}else{if(isset($param['row'])){$limit="0,".$param['row'];}else{$limit='0,'.cms_pagesize;}} - if(isset($param['orderby'])){$orderby=$param['orderby'];}else{$orderby='id desc';} + $modelname = 'article'; + if(isset($param['table'])){$modelname = $param['table'];} + + $model = \DB::table($modelname); - if(isset($param['sql'])) - { - $Artlist = db("article")->field('body',true)->where($param['sql'])->order($orderby)->limit($limit)->select(); - } - else + $size = sysconfig('CMS_PAGESIZE');$page = 1;$skip = 0; + if(isset($param['limit'])){$limit=explode(',',$param['limit']); $skip = $limit[0]; $size = $limit[1];}else{if(isset($param['row'])){$size = $param['row'];}} // 参数格式:$param['limit'] = '2,10';$param['row'] = 10; + + //查询条件 + $where = function ($query) use ($param) { + if(isset($param['tuijian'])) + { + $query->where('tuijian', $param['tuijian']); + //$query->where('title', 'like', '%'.$_REQUEST['keyword'].'%'); + } + + if(isset($param['typeid'])) + { + $query->where('typeid', $param["typeid"]); + } + + if(isset($param['image'])) + { + $query->where('litpic', '<>', ''); + } + }; + + if(!empty($where)){$model = $model->where($where);} + + //排序 + if(isset($param['orderby'])) { - $Artlist = db("article")->field('body',true)->where($map)->order($orderby)->limit($limit)->select(); + $orderby = $param['orderby']; + + if(count($orderby) == count($orderby, 1)) + { + $model = $model->orderBy($orderby[0], $orderby[1]); + } + else + { + foreach($orderby as $row) + { + $model = $model->orderBy($row[0], $row[1]); + } + } } + + //要返回的字段 + if(isset($param['field'])){$model = $model->select(\DB::raw($param['field']));} + + if($skip==0){$skip = ($page-1)*$size;} - return $Artlist; + return object_to_array($model->skip($skip)->take($size)->get()); } /** diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index 62db627..dc7e006 100644 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -1,49 +1,55 @@ $value) + $res = ''; + $where = function ($query) use ($res) { + if(isset($_REQUEST["keyword"])) + { + $query->where('title', 'like', '%'.$_REQUEST['keyword'].'%'); + } + + if(isset($_REQUEST["typeid"]) && $_REQUEST["typeid"]!=0) + { + $query->where('typeid', $_REQUEST["typeid"]); + } + + if(isset($_REQUEST["id"])) + { + $query->where('typeid', $_REQUEST["id"]); + } + }; + + $posts = parent::pageList('product', $where); + foreach($posts as $key=>$value) { - $info = db('product_type')->field('content',true)->where("id=".$value['typeid'])->find(); - $value['typename'] = $info['typename']; - $posts[] = $value; + $info = DB::table('product_type')->select('typename')->where("id", $value->typeid)->first(); + $posts[$key]->typename = $info->typename; + $posts[$key]->body = ''; } - $this->assign('page',$prolist->render()); - $this->assign('posts',$posts); + $data['posts'] = $posts; - return $this->fetch(); + return view('admin.product.index', $data); } public function add() { - if(!empty($_GET["catid"])){$this->assign('catid',$_GET["catid"]);}else{$this->assign('catid',0);} + $data = []; + if(!empty($_GET["catid"])){$data['catid'] = $_GET["catid"];}else{$data['catid'] = 0;} - return $this->fetch(); + return view('admin.product.add', $data); } public function doadd() @@ -51,7 +57,7 @@ class Product extends Base $litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图 if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description $_POST['addtime'] = $_POST['pubdate'] = time(); //添加&更新时间 - $_POST['user_id'] = session('admin_user_info')['id']; // 发布者id + $_POST['user_id'] = $_SESSION['admin_user_info']['id']; // 发布者id //关键词 if(!empty($_POST["keywords"])) @@ -69,15 +75,16 @@ class Product extends Base } } + unset($_POST["_token"]); if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} - if(db('product')->insert($_POST)) + if(DB::table('product')->insert($_POST)) { - $this->success('添加成功!', FLADMIN.'/Product' , 1); + success_jump('添加成功!', route('admin_product')); } else { - $this->error('添加失败!请修改后重新添加', FLADMIN.'/Product/add' , 3); + error_jump('添加失败!请修改后重新添加'); } } @@ -85,10 +92,10 @@ class Product extends Base { if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;} - $this->assign('id',$id); - $this->assign('post',db('product')->where("id=$id")->find()); + $data['id'] = $id; + $data['post'] = object_to_array(DB::table('product')->where('id', $id)->first(), 1); - return $this->fetch(); + return view('admin.product.edit', $data); } public function doedit() @@ -98,7 +105,7 @@ class Product extends Base $litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图 if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}}//description $_POST['pubdate'] = time();//更新时间 - $_POST['user_id'] = session('admin_user_info')['id']; // 修改者id + $_POST['user_id'] = $_SESSION['admin_user_info']['id']; // 修改者id //关键词 if(!empty($_POST["keywords"])) @@ -116,66 +123,65 @@ class Product extends Base } } + unset($_POST["_token"]); if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} - if(db('product')->where("id=$id")->update($_POST)) + if(DB::table('product')->where('id', $id)->update($_POST)) { - $this->success('修改成功!', FLADMIN.'/Product' , 1); + success_jump('修改成功!', route('admin_product')); } else { - $this->error('修改失败!', FLADMIN.'/Product/edit?id='.$_POST["id"] , 3); + error_jump('修改失败!'); } } public function del() { - if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Product' , 3);}if(preg_match('/[0-9]*/',$id)){}else{exit;} + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} - if(db('product')->where("id in ($id)")->delete()) + if(DB::table('product')->whereIn("id", explode(',', $id))->delete()) { - $this->success("$id ,删除成功", FLADMIN.'/Product' , 1); + success_jump("$id ,删除成功"); } else { - $this->error("$id ,删除失败!请重新提交", FLADMIN.'/Product', 3); + error_jump("$id ,删除失败!请重新提交"); } } //商品推荐 public function recommendarc() { - if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Product' , 3);} //if(preg_match('/[0-9]*/',$id)){}else{exit;} + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} $data['tuijian'] = 1; - - if(db('product')->where("id in ($id)")->update($data)) + if(DB::table('product')->whereIn("id", explode(',', $id))->update($data)) { - $this->success("$id ,推荐成功", FLADMIN.'/Product', 1); + success_jump("$id ,推荐成功"); } else { - $this->error("$id ,推荐失败!请重新提交", FLADMIN.'/Product', 3); + error_jump("$id ,推荐失败!请重新提交"); } } //商品是否存在 public function productexists() { - if(!empty($_GET["title"])) - { - $map['title'] = $_GET["title"]; - } - else - { - $map['title']=""; - } - - if(!empty($_GET["id"])) - { - $map['id'] = array('NEQ',$_GET["id"]); - } - - return db('product')->where($map)->count(); + $res = ''; + $where = function ($query) use ($res) { + if(isset($_REQUEST["title"])) + { + $query->where('title', $_REQUEST["title"]); + } + + if(isset($_REQUEST["id"])) + { + $query->where('id', '<>', $_REQUEST["id"]); + } + }; + + return DB::table("product")->where($where)->count(); } } \ No newline at end of file diff --git a/app/Http/Controllers/Admin/ProducttypeController.php b/app/Http/Controllers/Admin/ProducttypeController.php index 980656a..a170bd6 100644 --- a/app/Http/Controllers/Admin/ProducttypeController.php +++ b/app/Http/Controllers/Admin/ProducttypeController.php @@ -1,18 +1,20 @@ assign('catlist',tree(get_category('product_type',0))); - - return $this->fetch(); + $data['catlist'] = category_tree(get_category('product_type',0)); + return view('admin.producttype.index', $data); } public function add() @@ -21,18 +23,20 @@ class Producttype extends Base { $id = $_GET["reid"]; if(preg_match('/[0-9]*/',$id)){}else{exit;} + if($id!=0) { - $this->assign('postone',db("product_type")->field('content',true)->where("id=$id")->find()); + $data['postone'] = object_to_array(DB::table("product_type")->where('id', $id)->first(), 1); } - $this->assign('id',$id); + + $data['id'] = $id; } else { - $this->assign('id',0); + $data['id'] = 0; } - return $this->fetch(); + return view('admin.producttype.add', $data); } public function doadd() @@ -40,13 +44,16 @@ class Producttype extends Base if(isset($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}unset($_POST["prid"]);}//父级栏目id $_POST['addtime'] = time();//添加时间 - if(db("product_type")->insert($_POST)) + unset($_POST["_token"]); + if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} + + if(DB::table("product_type")->insert($_POST)) { - $this->success('添加成功!', FLADMIN.'/Producttype' , 1); + success_jump('添加成功!', route('admin_producttype')); } else { - $this->error('添加失败!请修改后重新添加', FLADMIN.'/Producttype' , 3); + error_jump('添加失败!请修改后重新添加'); } } @@ -54,13 +61,13 @@ class Producttype extends Base { $id = $_GET["id"];if(preg_match('/[0-9]*/',$id)){}else{exit;} - $this->assign('id',$id); - $post = db("product_type")->where("id=$id")->find(); + $data['id'] = $id; + $post = object_to_array(DB::table("product_type")->where('id', $id)->first(), 1); $reid = $post['reid']; - if($reid!=0){$this->assign('postone',db("product_type")->where("id=$reid")->find());} - $this->assign('post',$post); + if($reid!=0){$data['postone'] = object_to_array(DB::table("product_type")->where('id', $reid)->first(), 1);} + $data['post'] = $post; - return $this->fetch(); + return view('admin.producttype.edit', $data); } public function doedit() @@ -68,47 +75,50 @@ class Producttype extends Base if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;} $_POST['addtime'] = time();//添加时间 - if(db("product_type")->where("id=$id")->update($_POST)) + unset($_POST["_token"]); + if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} + + if(DB::table("product_type")->where('id', $id)->update($_POST)) { - $this->success('修改成功!', FLADMIN.'/Producttype' , 1); + success_jump('修改成功!', route('admin_producttype')); } else { - $this->error('修改失败!请修改后重新添加', FLADMIN.'/Producttype/edit?id='.$_POST["id"] , 3); + error_jump('修改失败!请修改后重新添加'); } } public function del() { - if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Producttype' , 3);} + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} - if(db("product_type")->where("reid=$id")->find()) + if(DB::table("product_type")->where('reid', $id)->first()) { - $this->error('删除失败!请先删除子分类', FLADMIN.'/Producttype', 3); + error_jump('删除失败!请先删除子分类'); } else { - if(db("product_type")->where("id=$id")->delete()) + if(DB::table("product_type")->where('id', $id)->delete()) { - if(db("product")->where("typeid=$id")->count()>0) //判断该分类下是否有商品,如果有把该分类下的商品也一起删除 + if(DB::table("product")->where('typeid', $id)->count()>0) //判断该分类下是否有商品,如果有把该分类下的商品也一起删除 { - if(db("product")->where("typeid=$id")->delete()) + if(DB::table("product")->where('typeid', $id)->delete()) { - $this->success('删除成功', FLADMIN.'/Producttype' , 1); + success_jump('删除成功'); } else { - $this->error('分类下的商品删除失败!', FLADMIN.'/Producttype', 3); + error_jump('分类下的商品删除失败!'); } } else { - $this->success('删除成功', FLADMIN.'/Producttype' , 1); + success_jump('删除成功'); } } else { - $this->error('删除失败!请重新提交', FLADMIN.'/Producttype', 3); + error_jump('删除失败!请重新提交'); } } } diff --git a/app/Http/Controllers/Home/IndexController.php b/app/Http/Controllers/Home/IndexController.php index 3382573..4dbe5d7 100644 --- a/app/Http/Controllers/Home/IndexController.php +++ b/app/Http/Controllers/Home/IndexController.php @@ -13,24 +13,199 @@ class IndexController extends CommonController parent::__construct(); } - public function index() + //首页 + public function index() { - $user = DB::table('article')->where('id', '1')->first(); - echo $user->title; - - //$Article = Article::find(1)->arctype; - //$Article = Article::find(1); - //$Article = Arctype::find(1)->article()->get()->toArray(); + return view('home.index.index'); + } + + //列表页 + public function category() + { + $cat=input('cat'); + $pagenow=input('page'); + + if(empty($cat) || !preg_match('/[0-9]+/',$cat)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;} + + if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = db('arctype')->where("id=$cat")->find();if(empty($post)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;}cache("catid$cat",$post,2592000);} + $this->assign('post',$post); + + $subcat="";$sql=""; + $post2=db('arctype')->field('id')->where("reid=$cat")->select(); + 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; + $this->assign('sql',$sql); - //$comment = Article::find(1)->arctype()->first()->toArray(); - //echo $comment->arctype->typename; - //print_r($comment); + $counts=db("article")->where($sql)->count('id'); + if($counts>CMS_MAXARC){$counts=CMS_MAXARC;} + $pagesize=CMS_PAGESIZE;$page=0; + if($counts % $pagesize){//取总数据量除以每页数的余数 + $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + }else{$pages = $counts/$pagesize;} + if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){header("HTTP/1.0 404 Not Found");$this->error('您访问的页面不存在或已被删除!');exit;}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} + $this->assign('page',$page); + $this->assign('pages',$pages); + $this->assign('counts',$counts); + $start=$page*$pagesize; - //dd($comment); + $this->assign('posts',arclist(array("sql"=>$sql,"limit"=>"$start,$pagesize"))); //获取列表 + $this->assign('pagenav',get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat))); //获取分页列表 + + if($post['templist']=='category2'){if(!empty($pagenow)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;}} + return $this->fetch($post['templist']); + return view('home.index.index'); } + + //文章详情页 + public function detail() + { + $id=input('id'); + if(empty($id) || !preg_match('/[0-9]+/',$id)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;} + + if(cache("detailid$id")){$post=cache("detailid$id");}else{$post = db('article')->where("id=$id")->find();if(empty($post)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;}$post['typename'] = db('arctype')->where("id=".$post['typeid'])->value('typename');cache("detailid$id",$post,2592000);} + if($post) + { + $cat=$post['typeid']; + $post['body']=ReplaceKeyword($post['body']); + if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} + + $this->assign('post',$post); + $this->assign('pre',get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre"))); + } + else + { + $this->error('您访问的页面不存在或已被删除!', '/' , 3);exit; + } + + if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = db('arctype')->where("id=$cat")->find();cache("catid$cat",$post,2592000);} + + return $this->fetch($post['temparticle']);return view('home.index.index'); + } + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 + public function tag() + { + $tag=input('tag'); + $pagenow=input('page'); + + if(empty($tag) || !preg_match('/[0-9]+/',$tag)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;} + + if(cache("tagid$tag")){$post=cache("tagid$tag");}else{$post = db('tagindex')->where("id=$tag")->find();cache("tagid$tag",$post,2592000);} + $this->assign('post',$post); + + $counts=db("taglist")->where("tid=$tag")->count('aid'); + if($counts>CMS_MAXARC){$counts=CMS_MAXARC;} + $pagesize=CMS_PAGESIZE;$page=0; + if($counts % $pagesize){//取总数据量除以每页数的余数 + $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + }else{$pages = $counts/$pagesize;} + if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){header("HTTP/1.0 404 Not Found");$this->error('您访问的页面不存在或已被删除!');exit;}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} + $this->assign('page',$page); + $this->assign('pages',$pages); + $this->assign('counts',$counts); + $start=$page*$pagesize; + + $posts=db("taglist")->where("tid=$tag")->order('aid desc')->limit("$start,$pagesize")->select(); + foreach($posts as $row) + { + $aid[] = $row["aid"]; + } + $aid = isset($aid)?implode(',',$aid):""; + + if($aid!="") + { + if($post['template']=='tag2') + { + $this->assign('posts',arclist(array("sql"=>"id in ($aid)","orderby"=>"id desc","limit"=>"$pagesize","field"=>"title,body"))); //获取列表 + } + else + { + $this->assign('posts',arclist(array("sql"=>"id in ($aid)","orderby"=>"id desc","limit"=>"$pagesize"))); //获取列表 + } + } + else + { + $this->assign('posts',""); //获取列表 + } + + $this->assign('pagenav',get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag"))); //获取分页列表 + + if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){$this->error('您访问的页面不存在或已被删除!', '/' , 3);exit;}} + return $this->fetch($post['template']); + return view('home.index.index'); + } + + //标签页 + public function tags() + { + return view('home.index.tags'); + } + + //搜索页 + public function search() + { + if(!empty($_GET["keyword"])) + { + $keyword = $_GET["keyword"]; //搜索的关键词 + if(strstr($keyword,"&")) exit; + + $map['title'] = array('LIKE',"%$keyword%"); + + $this->assign('posts',db("article")->field('body',true)->where($map)->order('id desc')->limit(30)->select()); + $this->assign('keyword',$keyword); + } + else + { + $this->error('请输入正确的关键词', '/' , 3);exit; + } + + return view('home.index.search'); + } + + //单页面 + public function page() + { + $id=input('id'); + + if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) + { + $map['filename']=$id; + if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = db('page')->where($map)->find();cache("pageid$id",$post,2592000);} + + if($post) + { + $this->assign('post',$post); + } + else + { + $this->error('您访问的页面不存在或已被删除!', '/' , 3);exit; + } + + } + else + { + $this->error('您访问的页面不存在或已被删除!', '/' , 3);exit; + } + + return view('home.index.'.$post['template']); + } + + //sitemap页面 + public function sitemap() + { + return $this->fetch(); + } + + //404页面 public function page404() { return view('home.404'); } + + //测试页面 + public function test() + { + return date("Y-m-d H:i:s",strtotime("2017-04")); + } } diff --git a/app/Http/Model/Arctype.php b/app/Http/Model/Arctype.php index b9fc78d..3ae0c9b 100644 --- a/app/Http/Model/Arctype.php +++ b/app/Http/Model/Arctype.php @@ -13,7 +13,6 @@ class Arctype extends Model * @var string */ protected $table = 'arctype'; - public $timestamps = false; /** * 表明模型是否应该被打上时间戳 diff --git a/app/Http/Model/Friendlink.php b/app/Http/Model/Friendlink.php new file mode 100644 index 0000000..ae5424c --- /dev/null +++ b/app/Http/Model/Friendlink.php @@ -0,0 +1,14 @@ +belongsTo(ProductType::class, 'typeid', 'id'); + } + +} diff --git a/app/Http/Model/ProductPic.php b/app/Http/Model/ProductPic.php new file mode 100644 index 0000000..f7ab507 --- /dev/null +++ b/app/Http/Model/ProductPic.php @@ -0,0 +1,13 @@ +hasMany(ProductType::class, 'typeid', 'id'); + } + +} diff --git a/app/Http/Model/Searchword.php b/app/Http/Model/Searchword.php new file mode 100644 index 0000000..afb16f5 --- /dev/null +++ b/app/Http/Model/Searchword.php @@ -0,0 +1,35 @@ +商品管理
商品列表
添加商品
-
商品分类
+
商品分类
批量维护
TAG标签管理
关键词管理
diff --git a/resources/views/admin/product/add.blade.php b/resources/views/admin/product/add.blade.php index 0320384..931fc6f 100644 --- a/resources/views/admin/product/add.blade.php +++ b/resources/views/admin/product/add.blade.php @@ -1,12 +1,12 @@ -添加商品信息_后台管理{include file="common/header"/} +添加商品信息_后台管理@include('admin.common.header')
- +
-
商品列表 > 添加商品
+
商品列表 > 添加商品
-
+{{ csrf_field() }} @@ -32,7 +32,7 @@ @@ -77,7 +77,7 @@ function upImage() @@ -137,40 +140,6 @@ $('#addcat input[type="submit"]').click(function(){ if(numError){ return false; } - - //$("#contents").val = ue.getContent(); - //var datas = $('#addcat').serialize();//#form要在form里面 - - //var content = ue.getContent(); - /* $.ajax({ - url: "/fladmin/Producttype/doedit", - type: "POST", - dataType: "json", - data: { - "id":$("#id").val(), - "typename":$("#typename").val(), - "typedir":$("#typedir").val(), - "templist":$("#templist").val(), - "temparticle":$("#temparticle").val(), - "litpic":$("#litpic").val(), - "seotitle":$("#seotitle").val(), - "keywords":$("#keywords").val(), - "seokeyword":$("#seokeyword").val(), - "description":$("#description").val(), - "content":content - //"seotitle":seotitle.replace("'", "'"), - //"keywords":keywords.replace("'", "'"), - //"description":description.replace("'", "'"), - //"contents":content.replace("'", "'") - }, - success: function(data){ - if(data.code==200) - { - //alert(data.info); - window.location.replace("/fladmin/Producttype"); - } - } - }); */ }); \ No newline at end of file diff --git a/resources/views/admin/producttype/edit.blade.php b/resources/views/admin/producttype/edit.blade.php index fa87588..4d61bdd 100644 --- a/resources/views/admin/producttype/edit.blade.php +++ b/resources/views/admin/producttype/edit.blade.php @@ -1,87 +1,84 @@ -修改分类_后台管理{include file="common/header"/} +修改分类_后台管理@include('admin.common.header')
- +
-
商品分类管理 > 修改分类
+
商品分类管理 > 修改分类
-
+{{ csrf_field() }}
推荐: 商品类目: - + - + - + - + - + + @@ -147,7 +147,7 @@ $(function(){ //var description = $("#description").val(); /*$.ajax({ - url: "/fladmin/Product/doedit", + url: "/fladmin/product/doedit", type: "POST", dataType: "json", cache: false, @@ -174,7 +174,7 @@ $(function(){ if(data.code==200) { //alert(data.info); - window.location.replace("/fladmin/Product"); + window.location.replace("/fladmin/product"); } } }); */ diff --git a/resources/views/admin/product/index.blade.php b/resources/views/admin/product/index.blade.php index a3c6a1d..a29b48a 100644 --- a/resources/views/admin/product/index.blade.php +++ b/resources/views/admin/product/index.blade.php @@ -1,9 +1,9 @@ -商品列表_<?php echo CMS_WEBNAME; ?>后台管理{include file="common/header"/} +商品列表_<?php echo sysconfig('CMS_WEBNAME'); ?>后台管理@include('admin.common.header')
- + -
- + + + + + @@ -37,15 +37,15 @@
商品标题:" class="required" style="width:60%" placeholder="在此输入标题">
货号:   运费:   销量:">   运费:">   销量:">
商品价格:   原价:   库存:   浏览次数:">   原价:">   库存:">   浏览次数:" style="width:60px;">
上架: -  是   -  否 + {if condition="$post['status']==0"}checked{/if} /> 是   + {if condition="$post['status']==1"}checked{/if} /> 否
推荐: @@ -40,11 +40,11 @@
seoTitle:" style="width:60%">
缩略图: " src="" width="120" height="80" id="picview" name="picview"> " style="width:40%"> " src="" width="120" height="80" id="picview" name="picview">
">"content","catid"=>$row["typeid"],"id"=>$row["id"])); ?>">预览 ">修改 ')" href="javascript:;">删除id; ?>title; ?> litpic)){echo "[图]";}if($row->tuijian==1){echo "[荐]";} ?> pubdate); ?>typename; ?>click; ?>"content","catid"=>$row->typeid,"id"=>$row->id)); ?>">预览 修改 删除
- +
-
{$page}
+
{{ $posts->links() }}
+
SEO标题:
- + - - - - - - - + - + - + - + - + - + - + - + - +
分类名称:" id="typename" size="30" class="required">
上级目录:">
别名: (包含字母或数字,字母开头)" id="typedir" class="required" style="width:30%"> (包含字母或数字,字母开头)
列表模板:" class="required" size="20">
文章模板:" class="required" size="20">
缩略图: " src="" width="120" height="80" id="picview" name="picview"> " style="width:40%"> " src="" width="120" height="80" id="picview" name="picview">
SEO标题:">
关键字: (用","分开)"> (用","分开)
SEO关键字: (用","分开)"> (用","分开)
分类描述:
分类内容:
- + @@ -139,40 +136,6 @@ $('#addcat input[type="submit"]').click(function(){ if(numError){ return false; } - - //$("#contents").val = ue.getContent(); - //var datas = $('#addcat').serialize();//#form要在form里面 - - //var content = ue.getContent(); - /* $.ajax({ - url: "/fladmin/Producttype/doedit", - type: "POST", - dataType: "json", - data: { - "id":$("#id").val(), - "typename":$("#typename").val(), - "typedir":$("#typedir").val(), - "templist":$("#templist").val(), - "temparticle":$("#temparticle").val(), - "litpic":$("#litpic").val(), - "seotitle":$("#seotitle").val(), - "keywords":$("#keywords").val(), - "seokeyword":$("#seokeyword").val(), - "description":$("#description").val(), - "content":content - //"seotitle":seotitle.replace("'", "'"), - //"keywords":keywords.replace("'", "'"), - //"description":description.replace("'", "'"), - //"contents":content.replace("'", "'") - }, - success: function(data){ - if(data.code==200) - { - //alert(data.info); - window.location.replace("/fladmin/Producttype"); - } - } - }); */ }); \ No newline at end of file diff --git a/resources/views/admin/producttype/index.blade.php b/resources/views/admin/producttype/index.blade.php index af34122..4c5e8b4 100644 --- a/resources/views/admin/producttype/index.blade.php +++ b/resources/views/admin/producttype/index.blade.php @@ -1,10 +1,10 @@ -商品分类_后台管理{include file="common/header"/} +商品分类_后台管理@include('admin.common.header') diff --git a/resources/views/home/common/footer.blade.php b/resources/views/home/common/footer.blade.php new file mode 100644 index 0000000..54c3ef1 --- /dev/null +++ b/resources/views/home/common/footer.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/home/common/header.blade.php b/resources/views/home/common/header.blade.php new file mode 100644 index 0000000..ab468e4 --- /dev/null +++ b/resources/views/home/common/header.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/home/index/category.blade.php b/resources/views/home/index/category.blade.php new file mode 100644 index 0000000..dc05281 --- /dev/null +++ b/resources/views/home/index/category.blade.php @@ -0,0 +1,62 @@ + +<?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?>" />" /> +@include('home.common.header')
+ + + +
+

热门文章

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"typeid"=>$post['id'],"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/category2.blade.php b/resources/views/home/index/category2.blade.php new file mode 100644 index 0000000..5d44062 --- /dev/null +++ b/resources/views/home/index/category2.blade.php @@ -0,0 +1,57 @@ + +<?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?>" />" /> +@include('home.common.header')
+ +

+
+ +
+

热门文章

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"typeid"=>$post['id'],"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/detail.blade.php b/resources/views/home/index/detail.blade.php new file mode 100644 index 0000000..9a2781c --- /dev/null +++ b/resources/views/home/index/detail.blade.php @@ -0,0 +1,60 @@ + +<?php if(!empty($post['seotitle'])){echo $post['seotitle'];}elseif(!empty($post['writer'])){echo $post['writertitle'].'_'.CMS_WEBNAME;}else{echo $post['title'].'_'.CMS_WEBNAME;} ?>" />" /> +@include('home.common.header')
+ +
+

'.$post['writer'].' '; } ?> '.$post['source'].' '; ?>阅读: 关键词:
+
+ +
+

近期文章

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"typeid"=>$post['typeid'],"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/index.blade.php b/resources/views/home/index/index.blade.php new file mode 100644 index 0000000..93b8c77 --- /dev/null +++ b/resources/views/home/index/index.blade.php @@ -0,0 +1,70 @@ + +<?php echo sysconfig('CMS_SEOTITLE'); ?> +
+ +
+
苹果/ThinkPad笔记本电脑无须担心质量问题。
+11,"where"=>array("tuijian"=>array('NEQ',1))));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?> +$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>" target="_blank">

..

+
'.$row['writer'].''; }elseif(!empty($row['source'])){ echo ''.$row['source'].''; } ?>人阅读
+ +
+
+ +
+ + +

文章排行

换一换
+
+ +

猜你喜欢

换一换
+
5,"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +
友情链接
+
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/login.blade.php b/resources/views/home/index/login.blade.php new file mode 100644 index 0000000..c44253f --- /dev/null +++ b/resources/views/home/index/login.blade.php @@ -0,0 +1,171 @@ + +后台登录 + + +
+
+
+
+
+

后台登录

+

请输入您的用户名、密码:

+
+
+ +
+
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/resources/views/home/index/page.blade.php b/resources/views/home/index/page.blade.php new file mode 100644 index 0000000..5403826 --- /dev/null +++ b/resources/views/home/index/page.blade.php @@ -0,0 +1,8 @@ + +<?php if(empty($post["seotitle"])){echo $post["title"];}else{echo $post["seotitle"];} ?>_<?php echo CMS_WEBNAME; ?>" />" /> +@include('home.common.header')
+ +
+

+
+
@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/search.blade.php b/resources/views/home/index/search.blade.php new file mode 100644 index 0000000..09b65f9 --- /dev/null +++ b/resources/views/home/index/search.blade.php @@ -0,0 +1,35 @@ + + +搜索结果_<?php echo CMS_WEBNAME; ?> + + +@include('home.common.header') +
+ +
+ +
+
>
+

搜索结果

+ +
$row['id'],"catid"=>$row['typeid'],"type"=>'content')).'">'.$row[';} ?> +$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>" target="_blank">

+
+ +
+ +
+ + +
+ +
+@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/sitemap.blade.php b/resources/views/home/index/sitemap.blade.php new file mode 100644 index 0000000..7bdce25 --- /dev/null +++ b/resources/views/home/index/sitemap.blade.php @@ -0,0 +1,9 @@ + + +http://www.nbnbk.com/daily1.0 +http://www.nbnbk.com/contact.html +300));foreach($posts as $row){ ?>http://www.nbnbk.com$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>monthly +100,"orderby"=>'rand()'));foreach($posts as $row){ ?>http://www.nbnbk.com$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>monthly + +http://www.nbnbk.com$row['id'],"type"=>'list')); ?> + \ No newline at end of file diff --git a/resources/views/home/index/tag.blade.php b/resources/views/home/index/tag.blade.php new file mode 100644 index 0000000..d9c394d --- /dev/null +++ b/resources/views/home/index/tag.blade.php @@ -0,0 +1,62 @@ + +<?php if(empty($post["title"])){echo $post["tag"];}else{echo $post["title"];}if($page!=0){echo ' '.($page+1);} ?>" />" /> +@include('home.common.header')
+ + + +
+

相关推荐

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/tag2.blade.php b/resources/views/home/index/tag2.blade.php new file mode 100644 index 0000000..07abf71 --- /dev/null +++ b/resources/views/home/index/tag2.blade.php @@ -0,0 +1,58 @@ + +<?php if(empty($post["title"])){echo $post["tag"];}else{echo $post["title"];}if($page!=0){echo ' '.($page+1);} ?>" />" /> +@include('home.common.header')
+ +

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

+ +
+

相关推荐

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/tag3.blade.php b/resources/views/home/index/tag3.blade.php new file mode 100644 index 0000000..deab26d --- /dev/null +++ b/resources/views/home/index/tag3.blade.php @@ -0,0 +1,57 @@ + +<?php if(empty($post["title"])){echo $post["tag"];}else{echo $post["title"];}if($page!=0){echo ' '.($page+1);} ?>" />" /> +@include('home.common.header')
+ +

+
+ +
+

相关推荐

换一换
+
+ +
+

猜你喜欢

换一换
+
5,"orderby"=>'rand()'));foreach($posts as $row){ ?>
$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
'.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
+ +
+ +@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/tags.blade.php b/resources/views/home/index/tags.blade.php new file mode 100644 index 0000000..12e1f53 --- /dev/null +++ b/resources/views/home/index/tags.blade.php @@ -0,0 +1,7 @@ + +笔记本电脑相关知识_<?php echo CMS_WEBNAME; ?> +@include('home.common.header')
+@include('home.common.footer') \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 2f96a6c..894699d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -21,7 +21,7 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function Route::get('/cat{cat}', 'IndexController@category'); //分类页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}', 'IndexController@tag'); //标签页 - Route::get('/page/{id}', 'IndexController@singlepage')->name('wap_singlepage'); //单页 + Route::get('/page/{id}', 'IndexController@singlepage')->name('wap_singlepage'); //单页 Route::get('/aaa', function () { dd('wap'); }); @@ -31,7 +31,7 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function //前台路由 Route::group(['namespace' => 'Home'], function () { Route::get('/', 'IndexController@index')->name('home'); - Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面 + Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面 Route::get('/tags', 'IndexController@tags')->name('tags'); Route::get('/search', 'IndexController@search'); Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页 @@ -39,7 +39,7 @@ Route::group(['namespace' => 'Home'], function () { Route::get('/cat{cat}', 'IndexController@category'); //分类页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}', 'IndexController@tag'); //标签页 - Route::get('/page/{id}', 'IndexController@page')->name('page'); //单页 + Route::get('/page/{id}', 'IndexController@page')->name('page'); //单页 Route::get('/aaa', function () { dd('wap'); @@ -69,6 +69,13 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/category/edit', 'CategoryController@edit')->name('admin_category_edit'); Route::post('/category/doedit', 'CategoryController@doedit')->name('admin_category_doedit'); Route::get('/category/del', 'CategoryController@del')->name('admin_category_del'); + //标签 + Route::get('/tag', 'TagController@index')->name('admin_tag'); + Route::get('/tag/add', 'TagController@add')->name('admin_tag_add'); + Route::post('/tag/doadd', 'TagController@doadd')->name('admin_tag_doadd'); + Route::get('/tag/edit', 'TagController@edit')->name('admin_tag_edit'); + Route::post('/tag/doedit', 'TagController@doedit')->name('admin_tag_doedit'); + Route::get('/tag/del', 'TagController@del')->name('admin_tag_del'); //单页 Route::get('/page', 'PageController@index')->name('admin_page'); Route::get('/page/add', 'PageController@add')->name('admin_page_add'); @@ -76,6 +83,22 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/page/edit', 'PageController@edit')->name('admin_page_edit'); Route::post('/page/doedit', 'PageController@doedit')->name('admin_page_doedit'); Route::get('/page/del', 'PageController@del')->name('admin_page_del'); + //产品 + Route::get('/product', 'ProductController@index')->name('admin_product'); + Route::get('/product/add', 'ProductController@add')->name('admin_product_add'); + Route::post('/product/doadd', 'ProductController@doadd')->name('admin_product_doadd'); + Route::get('/product/edit', 'ProductController@edit')->name('admin_product_edit'); + Route::post('/product/doedit', 'ProductController@doedit')->name('admin_product_doedit'); + Route::get('/product/del', 'ProductController@del')->name('admin_product_del'); + Route::get('/product/recommendarc', 'ProductController@recommendarc')->name('admin_product_recommendarc'); + Route::get('/product/articleexists', 'ProductController@productexists')->name('admin_product_productexists'); + //产品分类 + Route::get('/producttype', 'ProductTypeController@index')->name('admin_producttype'); + Route::get('/producttype/add', 'ProductTypeController@add')->name('admin_producttype_add'); + Route::post('/producttype/doadd', 'ProductTypeController@doadd')->name('admin_producttype_doadd'); + Route::get('/producttype/edit', 'ProductTypeController@edit')->name('admin_producttype_edit'); + Route::post('/producttype/doedit', 'ProductTypeController@doedit')->name('admin_producttype_doedit'); + Route::get('/producttype/del', 'ProductTypeController@del')->name('admin_producttype_del'); //友情链接 Route::get('/friendlink', 'FriendlinkController@index')->name('admin_friendlink'); Route::get('/friendlink/add', 'FriendlinkController@add')->name('admin_friendlink_add'); @@ -83,9 +106,6 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/friendlink/edit', 'FriendlinkController@edit')->name('admin_friendlink_edit'); Route::post('/friendlink/doedit', 'FriendlinkController@doedit')->name('admin_friendlink_doedit'); Route::get('/friendlink/del', 'FriendlinkController@del')->name('admin_friendlink_del'); - //在线留言管理 - Route::get('/guestbook', 'GuestbookController@index')->name('admin_guestbook'); - Route::get('/guestbook/del', 'GuestbookController@del')->name('admin_guestbook_del'); //关键词管理 Route::get('/keyword', 'KeywordController@index')->name('admin_keyword'); Route::get('/keyword/add', 'KeywordController@add')->name('admin_keyword_add'); @@ -93,13 +113,6 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/keyword/edit', 'KeywordController@edit')->name('admin_keyword_edit'); Route::post('/keyword/doedit', 'KeywordController@doedit')->name('admin_keyword_doedit'); Route::get('/keyword/del', 'KeywordController@del')->name('admin_keyword_del'); - //产品 - Route::get('/product', 'ProductController@index')->name('admin_product'); - Route::get('/product/add', 'ProductController@add')->name('admin_product_add'); - Route::post('/product/doadd', 'ProductController@doadd')->name('admin_product_doadd'); - Route::get('/product/edit', 'ProductController@edit')->name('admin_product_edit'); - Route::post('/product/doedit', 'ProductController@doedit')->name('admin_product_doedit'); - Route::get('/product/del', 'ProductController@del')->name('admin_product_del'); //搜索关键词 Route::get('/searchword', 'SearchwordController@index')->name('admin_searchword'); Route::get('/searchword/add', 'SearchwordController@add')->name('admin_searchword_add'); @@ -114,13 +127,9 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/slide/edit', 'SlideController@edit')->name('admin_slide_edit'); Route::post('/slide/doedit', 'SlideController@doedit')->name('admin_slide_doedit'); Route::get('/slide/del', 'SlideController@del')->name('admin_slide_del'); - //标签 - Route::get('/tag', 'TagController@index')->name('admin_tag'); - Route::get('/tag/add', 'TagController@add')->name('admin_tag_add'); - Route::post('/tag/doadd', 'TagController@doadd')->name('admin_tag_doadd'); - Route::get('/tag/edit', 'TagController@edit')->name('admin_tag_edit'); - Route::post('/tag/doedit', 'TagController@doedit')->name('admin_tag_doedit'); - Route::get('/tag/del', 'TagController@del')->name('admin_tag_del'); + //在线留言管理 + Route::get('/guestbook', 'GuestbookController@index')->name('admin_guestbook'); + Route::get('/guestbook/del', 'GuestbookController@del')->name('admin_guestbook_del'); //系统参数配置 Route::get('/sysconfig', 'SysconfigController@index')->name('admin_sysconfig'); Route::get('/sysconfig/add', 'SysconfigController@add')->name('admin_sysconfig_add');