view_suffix = config('view.view_suffix'); $this->tempHtml = "index_single.{$this->view_suffix}"; $id = $this->request->param("id"); $columnModel = Column::find($id); //栏目模型 View::assign("column", $this->columnHandle($columnModel)); if ($columnModel) { if (!empty($columnModel['column_template'])) { $this->tempHtml = $columnModel['column_template']; } } } public function index($id) { $single = \app\common\model\Single::where('column_id', $id)->find(); if ($single) { $single = []; } View::assign('single', $single); if (($this->templateType == 2 || $this->templateType == 3) && is_mobile()) { //判断是否手机访问 $tempHtml = $this->mobileHtml($this->tempHtml, $this->view_suffix); $templateMobilePath = $this->templateHtml . $tempHtml; if (file_exists($templateMobilePath)) { //判断文件是否存在 $this->tempHtml = $tempHtml; } } $template = $this->templateHtml . $this->tempHtml; $content = View::fetch($template); return access_stat_js($content, $this->domainNo); } }