51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
namespace Legu\Controller;
|
|
|
|
use Common\Controller\HomebaseController;
|
|
|
|
class IndexController extends HomebaseController {
|
|
protected $posts_model;
|
|
|
|
public function __construct() {
|
|
parent::__construct();
|
|
$this->assign('mtab',$_GET['mtab']);
|
|
}
|
|
|
|
public function index() {
|
|
$this->display(":index");
|
|
}
|
|
|
|
public function job() {
|
|
$this->display(":job");
|
|
}
|
|
|
|
public function news() {
|
|
$this->posts_model = D("Legu/News");
|
|
$list=$this->posts_model->where(array('status'=>array('neq',3),'type'=>1))->order('id desc')->select();
|
|
$this->assign('list',$list);
|
|
$list2=$this->posts_model->where(array('status'=>array('neq',3),'type'=>2))->order('id desc')->select();
|
|
$this->assign('list2',$list2);
|
|
$this->display(":news");
|
|
}
|
|
|
|
public function article() {
|
|
$id= I("get.id",0,'intval');
|
|
$this->posts_model = D("Legu/News");
|
|
$data=$this->posts_model->where(array('id'=>$id))->find();
|
|
$this->assign('data',$data);
|
|
$this->display(":article");
|
|
}
|
|
public function about() {
|
|
$this->display(":about");
|
|
}
|
|
|
|
public function contact() {
|
|
$this->display(":contact");
|
|
}
|
|
public function product() {
|
|
$this->display(":game");
|
|
}
|
|
}
|
|
|
|
|