init
This commit is contained in:
30
app/mobile/controller/Singlepage.php
Executable file
30
app/mobile/controller/Singlepage.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\mobile\controller;
|
||||
|
||||
use think\Loader;
|
||||
use think\Config;
|
||||
|
||||
class Singlepage extends BaseController {
|
||||
|
||||
public function detail($id = 0, $view = '') {
|
||||
if ($id > 0) {
|
||||
$singlepage = Loader::model('Singlepage')->getRow($id);
|
||||
if (empty($singlepage)) {
|
||||
return exception('数据有误,请检查后再操作');
|
||||
}
|
||||
$value['singlepage'] = $singlepage;
|
||||
$value['seo_title'] = $singlepage['seo_title']? : config('website_seo_title');
|
||||
$value['seo_keyword'] = $singlepage['seo_keyword']? : config('website_seo_keyword');
|
||||
$value['seo_description'] = $singlepage['seo_description']? : config('website_seo_description');
|
||||
$this->assign($value);
|
||||
if ($view) {
|
||||
return $this->fetch($view);
|
||||
} else {
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
return exception('数据有误,请检查后再操作');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user