Friendlink.php
932 字节
<?php
namespace app\index\controller;
use app\common\controller\Frontend;
use app\common\model\TemplateView;
use think\Db;
class Friendlink extends Frontend
{
protected $noNeedLogin = '*';
protected $noNeedRight = '*';
protected $layout = 'default';
protected $template = 'index';
public function _initialize()
{
parent::_initialize(); // TODO: Change the autogenerated stub
$template = TemplateView::getSchoolTemplate( $this->school_id);
$this->layout = $template->layout ?? 'default';
$this->template = $template->template_url;
}
public function index(){
$page = null;
$list = Db::name("friend_link")->where("school_id",$this->school_id)->paginate(10);
if(!empty($list)){
$page =$list->render();
}
$this->assign("page",$page);
$this->assign("list",$list);
return $this->view->fetch();
}
}