|
<?php
namespace app\index\controller;
use think\Db;
use app\index\controller\Base;
use app\admin\model\Category as CategoryModel;
use app\admin\model\Article as ArticleModel;
class Index extends Base
{
// public function __construct()
// {
// parent::__construct();
// }
public function index()
{
// 轮播图
$carouselData = Db::name('carousel')->order('id', 'desc')->limit(8)->select();
$this->assign('carouselData', $carouselData);
// var_dump($carouselData);
// exit;
$category_model = new CategoryModel();
// $categories = obj_tree($category_model->field('id, pid, name, url')->where('is_del', 0)->cache(false)->select());
// $this->assign('categories', $categories);
// var_dump($categories);
// exit;
$article_model = new ArticleModel();
// // 产品中心
// $data_product = $article_model->where(['is_del'=>0,'cid'=>2])
// ->field('id, cid, title, title_pic')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(3)
// ->select();
// $this->assign('data_product', $data_product);
// // 工程案例
// $data_case = $article_model->where(['is_del'=>0,'cid'=>4])
// ->field('id, cid, title, title_pic,summary')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(6)
// ->select();
// $this->assign('data_case', $data_case);
// // 荣誉资质
// $data_honour = $article_model->where(['is_del'=>0,'cid'=>5])
// ->field('id, cid, title, title_pic')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(6)
// ->select();
// $this->assign('data_honour', $data_honour);
// 最新动态
$data_news = $article_model->where(['is_del'=>0,'cid'=>3])
->field('id, cid, title, title_pic, summary,create_time')
->order(['sort' => 'desc', 'id' => 'desc'])
->limit(5)
->select();
$this->assign('data_news', $data_news);
// 合作伙伴
$partnerData = Db::name('partner')->field('id,picture, title')->select();
$this->assign('partnerData', $partnerData);
return $this->fetch();
}
public function indexcopy()
{
// 轮播图
$carouselData = Db::name('carousel')->order('id', 'desc')->limit(8)->select();
$this->assign('carouselData', $carouselData);
// var_dump($carouselData);
// exit;
$category_model = new CategoryModel();
// $categories = obj_tree($category_model->field('id, pid, name, url')->where('is_del', 0)->cache(false)->select());
// $this->assign('categories', $categories);
// var_dump($categories);
// exit;
$article_model = new ArticleModel();
// // 产品中心
// $data_product = $article_model->where(['is_del'=>0,'cid'=>2])
// ->field('id, cid, title, title_pic')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(3)
// ->select();
// $this->assign('data_product', $data_product);
// // 工程案例
// $data_case = $article_model->where(['is_del'=>0,'cid'=>4])
// ->field('id, cid, title, title_pic,summary')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(6)
// ->select();
// $this->assign('data_case', $data_case);
// // 荣誉资质
// $data_honour = $article_model->where(['is_del'=>0,'cid'=>5])
// ->field('id, cid, title, title_pic')
// ->order(['sort' => 'desc', 'id' => 'desc'])
// ->limit(6)
// ->select();
// $this->assign('data_honour', $data_honour);
// 最新动态
$data_news = $article_model->where(['is_del'=>0,'cid'=>3])
->field('id, cid, title, title_pic, summary,create_time')
->order(['sort' => 'desc', 'id' => 'desc'])
->limit(5)
->select();
$this->assign('data_news', $data_news);
// 合作伙伴
$partnerData = Db::name('partner')->field('id,picture, title')->select();
$this->assign('partnerData', $partnerData);
return $this->fetch();
}
// 联系我们
public function contactus()
{
// $this->meta['title'] = "联系我们";
// $this->assign('meta', $this->meta);
return $this->fetch();
}
// 关于我们
public function aboutus()
{
// $this->meta['title'] = "关于我们";
// $this->assign('meta', $this->meta);
return $this->fetch();
}
// challengeswesolve
public function challengeswesolve()
{
return $this->fetch();
}
// aerospace
public function aerospace()
{
return $this->fetch();
}
// becomeareseller
public function becomeareseller()
{
return $this->fetch();
}
// f120
public function f120()
{
return $this->fetch();
}
// fdm
public function fdm()
{
return $this->fetch();
}
// pps
public function pps()
{
return $this->fetch();
}
// materials
public function materials()
{
return $this->fetch();
}
public function download()
{
return $this->fetch();
}
public function vedio()
{
return $this->fetch();
}
public function automotive()
{
return $this->fetch();
}
}
|