mirror of https://gitee.com/karson/fastadmin.git
55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\index\controller\cms;
|
|
|
|
use addons\cms\model\Channel;
|
|
use addons\cms\model\Modelx;
|
|
use app\admin\model\Fields;
|
|
use app\common\controller\Frontend;
|
|
use addons\cms\model\Diyform as DiyformModel;
|
|
use fast\Tree;
|
|
use think\Config;
|
|
use think\Cookie;
|
|
use think\Exception;
|
|
use think\Hook;
|
|
use think\Session;
|
|
use think\Validate;
|
|
|
|
/**
|
|
* 会员中心
|
|
*/
|
|
class Diyform extends Frontend
|
|
{
|
|
|
|
protected $layout = 'default';
|
|
protected $noNeedLogin = [];
|
|
protected $noNeedRight = ['*'];
|
|
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
}
|
|
|
|
/**
|
|
* 表单
|
|
*/
|
|
public function index()
|
|
{
|
|
$diyname = $this->request->param('diyname');
|
|
if ($diyname && !is_numeric($diyname)) {
|
|
$diyform = DiyformModel::getByDiyname($diyname);
|
|
} else {
|
|
$id = $diyname ? $diyname : $this->request->get('id', '');
|
|
$diyform = DiyformModel::get($id);
|
|
}
|
|
if (!$diyform || $diyform['status'] == 'hidden') {
|
|
$this->error(__('表单未找到'));
|
|
}
|
|
$fields = DiyformModel::getDiyformFields($diyform['id']);
|
|
$this->view->assign('diyform', $diyform);
|
|
$this->view->assign('fields', $fields);
|
|
|
|
return $this->view->fetch();
|
|
}
|
|
}
|