返回小型企业站前台......登陆

小型企业站前台模块

12019-06-17 16:17:3260

<?php

namespace app\index\controller;


use think\Controller;

use think\facade\Request;

use app\index\model\Product;

use app\index\model\Slide;

use app\index\model\Newsl;

use app\index\model\System;

use app\index\model\Product as Db;



class Index extends Controller

{

    public function index()

    {

    //轮播图

    $lunbo = Slide::order('slide_id')->limit(4)->all();

    //查询头牌

    $toupan = Product::order('product_id')->limit(4)->all();


    //最新资讯

    $zixun  = Newsl::order('news_id')->limit(2)->all();


    //新上花魁

    $huakui = Product::order('product_id')->limit(1)->all();

    $this->assign('toupan',$toupan);

    $this->assign('huakui',$huakui);

    $this->assign('zixun',$zixun);

    $this->assign('lunbo',$lunbo);

   

       return $this->fetch();

    }

    public function about()

    {


       $gyu = System::all();

       $this->assign('gyu',$gyu);

       return $this->fetch();

    }

    public function connew()

    {


    $data = Request::param();



    $news_id = $data['news_id'];


    $news = Newsl::where('news_id',$news_id)->find();


    //查询热门新闻一条

    $newsrm = Newsl::order('news_id','desc')->find();

   

    $this->assign('newsrm',$newsrm);


    $this->assign('news',$news);

   

       return $this->fetch();

    }

    public function conpro()

    {

       return $this->fetch();

    }

    public function news()

    {

    //查询新闻热点两条

    $newsrmx = Newsl::order('news_id')->limit(2)->all();


    //查询热门新闻一条

    $newsrm = Newsl::order('news_id','desc')->limit(1)->all();


    //查询最新发布

    $newszx = Newsl::order('news_id','desc')->limit(4)->all();


    $this->assign('newsrmx',$newsrmx);

    $this->assign('newsrm',$newsrm);

    $this->assign('newszx',$newszx);

       return $this->fetch();

    }

    public function product()

    {

       $product = Db::order('product_id')->limit(3)->all();

       $this->assign('product',$product);

       return $this->fetch();

    }

    public function hello($name = 'ThinkPHP5')

    {

        return 'hello,' . $name;

    }

}

[]1NVBVRS_I[D27GFW59JGO.png

最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送
  • PHP中文网