Exemplo n.º 1
0
 private function detail()
 {
     $nav = new navModel();
     $article = new articleModel();
     $product = new productModel();
     if (isset($_GET['id']) && !empty($_GET['id'])) {
         //Tools::dump($_GET);
         $article->id = $_GET['id'];
         $article->updateArticle();
         $oneArticle = $article->getOneArticle();
         $product->cid = $oneArticle->cid;
         //Tools::dump($product->cid);
         //Tools::dump($product->getAllProductsByCID());
         $this->smarty->assign("oneArticle", $oneArticle);
         $nav->id = $oneArticle->nid;
         $subNav = $nav->getOneNav();
         $this->smarty->assign("subNav", $subNav);
         $nav->id = $subNav->pid;
         $mainNav = $nav->getOneNav();
         $this->smarty->assign("mainNav", $mainNav);
         $this->smarty->assign("recommend", $product->getAllProductsByCID());
         //Tools::dump($mainNav);
     } else {
         Tools::Redirect("", "home.php");
     }
 }
Exemplo n.º 2
0
 /**
  * 根据文章的id显示单篇文章
  *   */
 private function detail()
 {
     /* if(Tools::isSession("oneUserName")){
               Tools::Redirect("只有注册会员才可以浏览","?",2,1);
        } */
     $nav = new navModel();
     $product = new productModel();
     if (isset($_GET['id']) && !empty($_GET['id'])) {
         //Tools::dump($_GET);
         $this->model->id = $_GET['id'];
         $this->model->updateArticle();
         $oneArticle = $this->model->getOneArticle();
         $product->cid = $oneArticle->cid;
         //Tools::dump($product->cid);
         //Tools::dump($product->getAllProductsByCID());
         $this->smarty->assign("oneArticle", $oneArticle);
         $nav->id = $oneArticle->nid;
         $subNav = $nav->getOneNav();
         $this->smarty->assign("subNav", $subNav);
         $nav->id = $subNav->pid;
         $mainNav = $nav->getOneNav();
         $this->smarty->assign("mainNav", $mainNav);
         $this->smarty->assign("recommend", $product->getAllProductsByCID());
         //Tools::dump($mainNav);
     } else {
         Tools::Redirect("", "home.php");
     }
     $this->smarty->display("home/demo.html");
 }